Neues Beispiel.
Change-Id: I634c394d3879ba84839db742fe300612e8f2941b
diff --git a/README b/README
index 2b83c68..dd0828f 100644
--- a/README
+++ b/README
@@ -95,6 +95,10 @@
4. Eine Waffe, die ihren Besitzer mehr Schaden macht. Ausserdem ein Beispiel
fuer eine Prop, die per Inline-Closure gesetzt wird.
obj/axt2.c
-5. Eine Waffe, die nur fuer einen NPC zu zuecken ist, nicht fuer Spieler.
+5. Eine Waffe, die nur fuer einen bestimmten NPC zu zuecken ist, nicht fuer
+ Spieler.
obj/axt3.c
+6. Eine Waffe, die nur fuer beliebige NPCs zu zuecken ist, nicht fuer
+ Spieler.
+ obj/axt3b.c
diff --git a/obj/axt3.c b/obj/axt3.c
index 951e329..06e029d 100644
--- a/obj/axt3.c
+++ b/obj/axt3.c
@@ -45,7 +45,7 @@
}
public string wield_check() {
- if (interactive(ENV()))
+ if (loadname(ENV()) != __PATH__(1)"npc/zwerg4")
return BSLF(
"Dies ist Kawumms persoenliche Axt. Sie ist so dermassen unhandlich, "
"dass Du sie nicht zuecken kannst.");
diff --git a/obj/axt3b.c b/obj/axt3b.c
new file mode 100644
index 0000000..a2fbf7f
--- /dev/null
+++ b/obj/axt3b.c
@@ -0,0 +1,38 @@
+inherit "/std/weapon";
+
+#include <new_skills.h>
+#include __PATH__(1)"defs.h"
+
+
+protected void create() {
+ if (!clonep()) {
+ set_next_reset(-1);
+ return;
+ }
+ ::create();
+
+ SetProp(P_SHORT, "Eine besondere Axt");
+ SetProp(P_LONG, BSLF(
+ "Dies ist die Axt von Kawumm, dem Zwerg. Sie ist allerdings nicht fuer "
+ "Spielerhaende gedacht."));
+
+ SetProp(P_NAME, "Axt");
+ SetProp(P_GENDER, FEMALE);
+ AddId(({"axt"}));
+
+ SetProp(P_WC, 180);
+ SetProp(P_WEAPON_TYPE, WT_AXE);
+ SetProp(P_DAM_TYPE, DT_SLASH);
+ SetProp(P_NR_HANDS, 1);
+
+ /* Als Variante des letzten Beispieles: Wenn es egal ist, welcher NPC
+ die Axt zuecken darf, dann geht es auch ohne zusaetzliche Function: */
+ SetProp(P_RESTRICTIONS, ([SR_PROP: ([P_NPC:1])]));
+
+ SetProp(P_VALUE, 200);
+ SetProp(P_WEIGHT, 3250);
+ SetProp(P_SIZE, 90);
+
+ SetProp(P_MATERIAL, ([MAT_STEEL:100]));
+}
+