Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Also transfers old spears damage to new explosive spear. (Fixes plasma spears.)
  • Loading branch information
Rockdtben authored and actioninja committed Sep 23, 2019
1 parent 4112b89 commit d89aba9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion code/datums/components/crafting/recipes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

/datum/crafting_recipe/lance
name = "Explosive Lance (Grenade)"
result = /obj/item/twohanded/spear
result = /obj/item/twohanded/spear/explosive
reqs = list(/obj/item/twohanded/spear = 1,
/obj/item/grenade = 1)
blacklist = list(/obj/item/twohanded/spear/explosive, /obj/item/twohanded/spear/bonespear)
Expand Down
24 changes: 15 additions & 9 deletions code/game/objects/items/twohanded.dm
Original file line number Diff line number Diff line change
Expand Up @@ -492,15 +492,6 @@
icon_prefix = "spearplasma"
update_icon()
qdel(tip)
var/obj/item/grenade/G = locate() in parts_list
if(G)
var/obj/item/twohanded/spear/explosive/lance = new /obj/item/twohanded/spear/explosive(src.loc, G)
lance.force_wielded = force_wielded
lance.force_unwielded = force_unwielded
lance.throwforce = throwforce
lance.icon_prefix = icon_prefix
parts_list -= G
qdel(src)
..()


Expand All @@ -517,6 +508,21 @@
desc = "A makeshift spear with [G] attached to it"
update_icon()


/obj/item/twohanded/spear/explosive/CheckParts(list/parts_list)
var/obj/item/grenade/G = locate() in parts_list
if(G)
var/obj/item/twohanded/spear/lancePart = locate() in parts_list
force_wielded = lancePart.force_wielded
force_unwielded = lancePart.force_unwielded
throwforce = lancePart.throwforce
icon_prefix = lancePart.icon_prefix
parts_list -= G
parts_list -= lancePart
Initialize(src.loc, G)
qdel(lancePart)
..()

/obj/item/twohanded/spear/explosive/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins to sword-swallow \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.say("[war_cry]", forced="spear warcry")
Expand Down

0 comments on commit d89aba9

Please sign in to comment.