bigsword.c

./lib/players/josh/room/mage/dungeon/obj/bigsword.c · 1.3 KB

From the archive h7v3.0a.tar.gz

Download the archive   « Back to the archive contents

inherit "inherit/weapon";

reset(arg) {
    if(arg) return;

    set_name("bigsword");
    set_alias("sword");
    set_short("A huge sword.");
    set_long(
      "This is a huge broad sword. Only some kind of "+
"giant could wield this.\n"
);
    set_wc(16);
    set_type("slash");
    set_length(45);  /* a little longer than normal */
    set_weight(8);
    set_value(4000);
    set_hit_func(this_object());
}


init() {
    ::init();
    add_action("read","read sword");
}

read(string str) {
    string tmp1, tmp2;
    if(sscanf(str, "%srunes%s", tmp1, tmp2)) {
	if(this_player()->query_languages("elf"))
	    write(query_info());
	else
	    write("They don't make any sense to you.\n");
	return 1;
    }
}

query_info() {
    return "the runes on the blade glow as you read them...\n"+
    "they say - 'Evil beware!'\n";
}

weapon_hit(object target) {
    if(target -> query_alignment() < -100) {
	tell_object(environment(), "Your sword glows a brilliant white!\n");
	say(environment()->query_name() +"'s sword throws sparks !\n"
	);
	return 3;
    }
    return 0;
}

wield(string str) {
    ::wield(str);
    if(id(str)) {
	if(this_player()->query_alignment() !=  0) {
	    tell_object(environment(), "This sword is too big to wield.\n");
	    drop();
	}
	return 1;
    }
}

Site Stats

Snippets: 1791
Codebases: 571