Skip to content

Commit

Permalink
Add item subtype (weapon/ammunition type) constants
Browse files Browse the repository at this point in the history
Signed-off-by: Haru <haru@dotalux.com>
  • Loading branch information
MishimaHaruna committed Sep 17, 2017
1 parent 74d54ad commit 9047b6c
Show file tree
Hide file tree
Showing 2 changed files with 70 additions and 32 deletions.
65 changes: 33 additions & 32 deletions doc/item_db.txt
Expand Up @@ -244,40 +244,41 @@ View: For normal items, defines a replacement view-sprite for the item (eg:
and ammo where this value indicates the weapon-class of the item.

For weapons, the types are:
0: bare fist
1: Daggers
2: One-handed swords
3: Two-handed swords
4: One-handed spears
5: Two-handed spears
6: One-handed axes
7: Two-handed axes
8: Maces
9: Unused
10: Staves
11: Bows
12: Knuckles
13: Musical Instruments
14: Whips
15: Books
16: Katars
17: Revolvers
18: Rifles
19: Gatling guns
20: Shotguns
21: Grenade launchers
22: Fuuma Shurikens
W_FIST 0: Bare fist
W_DAGGER 1: Daggers
W_1HSWORD 2: One-handed swords
W_2HSWORD 3: Two-handed swords
W_1HSPEAR 4: One-handed spears
W_2HSPEAR 5: Two-handed spears
W_1HAXE 6: One-handed axes
W_2HAXE 7: Two-handed axes
W_MACE 8: Maces
W_2HMACE 9: Unused
W_STAFF 10: Staves
W_BOW 11: Bows
W_KNUCKLE 12: Knuckles
W_MUSICAL 13: Musical instruments
W_WHIP 14: Whips
W_BOOK 15: Books
W_KATAR 16: Katars
W_REVOLVER 17: Reveolvers
W_RIFLE 18: Rifles
W_GATLING 19: Gatling guns
W_SHOTGUN 20: Shotguns
W_GRENADE 21: Grenade launchers
W_HUUMA 22: Fuuma shurikens
W_2HSTAFF 23: Two-handed staves

For ammo, the types are:
1: Arrows
2: Throwable daggers
3: Bullets
4: Shells
5: Grenades
6: Shuriken
7: Kunai
8: Cannonballs
9: Throwable Items (Sling Item)
A_ARROW 1: Arrows
A_DAGGER 2: Throwable daggers
A_BULLET 3: Bullets
A_SHELL 4: Shells
A_GRENADE 5: Grenades
A_SHURIKEN 6: Shuriken
A_KUNAI 7: Kunai
A_CANNONBALL 8: Cannon balls
A_THROWWEAPON 9: Throwable items (Sling Item)

BindOnEquip: Whether the item will automatically bind to the character when it
is equipped for the first time. An item that has this field set,
Expand Down
37 changes: 37 additions & 0 deletions src/map/script.c
Expand Up @@ -24480,6 +24480,43 @@ void script_hardcoded_constants(void)
script->set_constant("DATATYPE_VAR", DATATYPE_VAR, false, false);
script->set_constant("DATATYPE_LABEL", DATATYPE_LABEL, false, false);

script->constdb_comment("Item Subtypes (Weapon types)");
script->set_constant("W_FIST", W_FIST, false, false);
script->set_constant("W_DAGGER", W_DAGGER, false, false);
script->set_constant("W_1HSWORD", W_1HSWORD, false, false);
script->set_constant("W_2HSWORD", W_2HSWORD, false, false);
script->set_constant("W_1HSPEAR", W_1HSPEAR, false, false);
script->set_constant("W_2HSPEAR", W_2HSPEAR, false, false);
script->set_constant("W_1HAXE", W_1HAXE, false, false);
script->set_constant("W_2HAXE", W_2HAXE, false, false);
script->set_constant("W_MACE", W_MACE, false, false);
script->set_constant("W_2HMACE", W_2HMACE, false, false);
script->set_constant("W_STAFF", W_STAFF, false, false);
script->set_constant("W_BOW", W_BOW, false, false);
script->set_constant("W_KNUCKLE", W_KNUCKLE, false, false);
script->set_constant("W_MUSICAL", W_MUSICAL, false, false);
script->set_constant("W_WHIP", W_WHIP, false, false);
script->set_constant("W_BOOK", W_BOOK, false, false);
script->set_constant("W_KATAR", W_KATAR, false, false);
script->set_constant("W_REVOLVER", W_REVOLVER, false, false);
script->set_constant("W_RIFLE", W_RIFLE, false, false);
script->set_constant("W_GATLING", W_GATLING, false, false);
script->set_constant("W_SHOTGUN", W_SHOTGUN, false, false);
script->set_constant("W_GRENADE", W_GRENADE, false, false);
script->set_constant("W_HUUMA", W_HUUMA, false, false);
script->set_constant("W_2HSTAFF", W_2HSTAFF, false, false);

script->constdb_comment("Item Subtypes (Ammunition types)");
script->set_constant("A_ARROW", A_ARROW, false, false);
script->set_constant("A_DAGGER", A_DAGGER, false, false);
script->set_constant("A_BULLET", A_BULLET, false, false);
script->set_constant("A_SHELL", A_SHELL, false, false);
script->set_constant("A_GRENADE", A_GRENADE, false, false);
script->set_constant("A_SHURIKEN", A_SHURIKEN, false, false);
script->set_constant("A_KUNAI", A_KUNAI, false, false);
script->set_constant("A_CANNONBALL", A_CANNONBALL, false, false);
script->set_constant("A_THROWWEAPON", A_THROWWEAPON, false, false);

script->constdb_comment("Renewal");
#ifdef RENEWAL
script->set_constant("RENEWAL", 1, false, false);
Expand Down

0 comments on commit 9047b6c

Please sign in to comment.