Merge pull request #4475 from Neerti/12/31/2017

Adds Visual Cleavage
This commit is contained in:
Anewbe
2018-01-02 20:04:50 -05:00
committed by GitHub
6 changed files with 48 additions and 2 deletions
@@ -100,3 +100,4 @@
icon_state = "survivalknife"
item_state = "knife"
applies_material_colour = FALSE
should_cleave = FALSE
@@ -32,6 +32,13 @@
origin_tech = list(TECH_MATERIAL = 2, TECH_COMBAT = 1)
attack_verb = list("chopped", "torn", "cut")
applies_material_colour = 0
var/should_cleave = TRUE // Because knives inherit from hatchets. For some reason.
// This cannot go into afterattack since some mobs delete themselves upon dying.
/obj/item/weapon/material/hatchet/pre_attack(var/mob/living/target, var/mob/living/user)
if(should_cleave && istype(target))
cleave(user, target)
..()
/obj/item/weapon/material/hatchet/unathiknife
name = "duelling knife"
@@ -39,6 +46,7 @@
icon = 'icons/obj/weapons.dmi'
icon_state = "unathiknife"
attack_verb = list("ripped", "torn", "cut")
should_cleave = FALSE
var hits = 0
/obj/item/weapon/material/hatchet/unathiknife/attack(mob/M as mob, mob/user as mob)
@@ -56,6 +64,7 @@
hits = initial(hits)
..()
// These probably shouldn't inherit from hatchets.
/obj/item/weapon/material/hatchet/tacknife
name = "tactical knife"
desc = "You'd be killing loads of people if this was Medal of Valor: Heroes of Space."
@@ -64,6 +73,7 @@
item_state = "knife"
attack_verb = list("stabbed", "chopped", "cut")
applies_material_colour = 1
should_cleave = FALSE
/obj/item/weapon/material/hatchet/tacknife/combatknife
name = "combat knife"
@@ -75,6 +85,7 @@
thrown_force_divisor = 1.75 // 20 with weight 20 (steel)
attack_verb = list("sliced", "stabbed", "chopped", "cut")
applies_material_colour = 1
should_cleave = FALSE
/obj/item/weapon/material/minihoe // -- Numbers
name = "mini hoe"
@@ -97,6 +97,12 @@
icon_state = initial(icon_state)
to_chat(user, "<span class='notice'>\The [src] is de-energised. It's just a regular axe now.</span>")
// This cannot go into afterattack since some mobs delete themselves upon dying.
/obj/item/weapon/melee/energy/axe/pre_attack(var/mob/living/target, var/mob/living/user)
if(istype(target))
cleave(user, target)
..()
/obj/item/weapon/melee/energy/axe/suicide_act(mob/user)
visible_message("<span class='warning'>\The [user] swings \the [src] towards \his head! It looks like \he's trying to commit suicide.</span>")
return (BRUTELOSS|FIRELOSS)