Creates special_attack for kitchen equipment

Makes the attacks their own proc.
This commit is contained in:
Twinmold
2017-04-05 23:45:52 -05:00
parent 3e27971e3d
commit 7235a0dd98
5 changed files with 99 additions and 86 deletions
@@ -42,7 +42,7 @@
if(istype(check, /obj/item/weapon/reagent_containers/food/snacks))
return 1
if(istype(check, /obj/item/weapon/grab))
return 0
return special_attack(check, user)
to_chat(user, "<span class ='notice'>You can only process food!</span>")
return 0
@@ -113,36 +113,6 @@
to_chat(user, "<span class='warning'>Close the panel first!</span>")
return
if(!checkValid(I, user))
if(istype(I, /obj/item/weapon/grab))
var/obj/item/weapon/grab/G = I
if(istype(G.affecting, /mob/living/carbon/human) && (G.affecting.get_species() != "Machine"))
// if(!iscarbon(G.affecting))
// to_chat(user, "<span class='warning'>You can only harm carbon-based creatures this way!</span>")
// return
// if(G.affecting.stat == DEAD)
// to_chat(user, "<span class='warning'>[G.affecting] is dead!</span>")
// return
if(G.state < GRAB_AGGRESSIVE)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return
var/mob/living/carbon/human/C = G.affecting
var/obj/item/organ/external/head/head = C.get_organ("head")
if(!head)
to_chat(user, "<span class='warning'>This person doesn't have a head!</span>")
return
if(istype(src, /obj/machinery/cooker/deepfryer))
C.visible_message("<span class='danger'>[user] dunks [C]'s face into [src]!</span>", \
"<span class='userdanger'>[user] dunks your face into [src]!</span>")
if(!C.stat)
C.emote("scream")
user.changeNext_move(CLICK_CD_MELEE)
C.apply_damage(25, BURN, "head") //25 fire damage and disfigurement because your face was just deep fried!
head.disfigure("burn")
add_logs(G.assailant, G.affecting, "deep-fried face")
qdel(I) //Removes the grip so the person MIGHT have a small chance to run the fuck away and to prevent rapid dunks.
return
else
to_chat(user, "<span class='warning'>You can only harm carbon-based creatures this way!</span>")
return
if(!burns)
if(istype(I, /obj/item/weapon/reagent_containers/food/snacks))
@@ -176,6 +146,9 @@
turnoff(I)
//qdel(I)
/obj/machinery/cooker/proc/special_attack(obj/item/weapon/grab/G, mob/user)
return 0
// MAKE SURE TO OVERRIDE THESE ON THE MACHINE IF IT HAS SPECIAL FOOD INTERACTIONS!
// FAILURE TO OVERRIDE WILL RESULT IN FAILURE TO PROPERLY HANDLE SPECIAL INTERACTIONS! --FalseIncarnate
/obj/machinery/cooker/proc/checkSpecials(obj/item/I)
@@ -43,6 +43,37 @@
var/obj/item/weapon/reagent_containers/food/snacks/deepfryholder/type = new(get_turf(src))
return type
/obj/machinery/cooker/deepfryer/special_attack(obj/item/weapon/grab/G, mob/user)
if(istype(G.affecting, /mob/living/carbon/human))
// if(!iscarbon(G.affecting))
// to_chat(user, "<span class='warning'>You can only harm carbon-based creatures this way!</span>")
// return 0
// if(G.affecting.stat == DEAD)
// to_chat(user, "<span class='warning'>[G.affecting] is dead!</span>")
// return 0
if(G.state < GRAB_AGGRESSIVE)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return 0
var/mob/living/carbon/human/C = G.affecting
var/obj/item/organ/external/head/head = C.get_organ("head")
if(!head)
to_chat(user, "<span class='warning'>This person doesn't have a head!</span>")
return 0
C.visible_message("<span class='danger'>[user] dunks [C]'s face into [src]!</span>", \
"<span class='userdanger'>[user] dunks your face into [src]!</span>")
if(!C.stat)
C.emote("scream")
user.changeNext_move(CLICK_CD_MELEE)
if(!(head.status & ORGAN_ROBOT))
C.apply_damage(25, BURN, "head") //25 fire damage and disfigurement because your face was just deep fried!
head.disfigure("burn")
add_logs(G.assailant, G.affecting, "deep-fried face")
qdel(G) //Removes the grip so the person MIGHT have a small chance to run the fuck away and to prevent rapid dunks.
else
to_chat(user, "<span class='warning'>You can only harm carbon-based creatures this way!</span>")
return 0
/obj/machinery/cooker/deepfryer/checkSpecials(obj/item/I)
if(!I)
return 0
@@ -43,3 +43,36 @@
for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
E += M.rating
efficiency = round((E/2), 1) // There's 2 lasers, so halve the effect on the efficiency to keep it balanced
/obj/machinery/kitchen_machine/grill/special_attack(obj/item/weapon/grab/G, mob/user)
if(istype(G.affecting, /mob/living/carbon/human))
if(G.state < GRAB_AGGRESSIVE)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return 1
var/mob/living/carbon/human/C = G.affecting
var/obj/item/organ/external/head/head = C.get_organ("head")
var/obj/item/organ/external/chest/chest = C.get_organ("chest")
var/obj/item/organ/external/arm/l_arm = C.get_organ("l_arm")
var/obj/item/organ/external/arm/right/r_arm = C.get_organ("r_arm")
if(!head)
to_chat(user, "<span class='warning'>This person doesn't have a head!</span>")
return 1
C.visible_message("<span class='danger'>[user] forces [C] onto [src], searing [C]'s upper body!</span>", \
"<span class='userdanger'>[user] forces you onto [src]! It burns!</span>")
if(!C.stat)
C.emote("scream")
user.changeNext_move(CLICK_CD_MELEE)
if(!(head.status & ORGAN_ROBOT))
C.apply_damage(10, BURN, "head") //30 overall upper body damage because your body was just placed over a hot grill!
if(!(chest.status & ORGAN_ROBOT))
C.apply_damage(10, BURN, "chest")
if(!(l_arm.status & ORGAN_ROBOT))
C.apply_damage(5, BURN, "l_arm")
if(!(r_arm.status & ORGAN_ROBOT))
C.apply_damage(5, BURN, "r_arm")
add_logs(G.assailant, G.affecting, "burns on a grill")
qdel(G) //Removes the grip to prevent rapid sears and give you a chance to run
return 1
else
to_chat(user, "<span class='warning'>You can only harm carbon-based creatures this way!</span>")
return 0
@@ -155,61 +155,7 @@
return 1
//G.reagents.trans_to(src,G.amount_per_transfer_from_this)
else if(istype(O,/obj/item/weapon/grab))
var/obj/item/weapon/grab/G = O
if(!istype(src, /obj/machinery/kitchen_machine/oven) && !istype(src, /obj/machinery/kitchen_machine/grill))
to_chat(user, "<span class='alert'>This is ridiculous. You can not fit \the [G.affecting] in this [src].</span>")
return 1
if(istype(G.affecting, /mob/living/carbon/human) && (G.affecting.get_species() != "Machine"))
// if(!iscarbon(G.affecting))
// to_chat(user, "<span class='warning'>You can only harm carbon-based creatures this way!</span>")
// return 1
// if(G.affecting.stat == DEAD)
// to_chat(user, "<span class='warning'>[G.affecting] is dead!</span>")
// return 1
if(G.state < GRAB_AGGRESSIVE)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return 1
var/mob/living/carbon/human/C = G.affecting
var/obj/item/organ/external/head/head = C.get_organ("head")
if(!head)
to_chat(user, "<span class='warning'>This person doesn't have a head!</span>")
return 1
if(istype(src, /obj/machinery/kitchen_machine/oven))
if(G.state < GRAB_AGGRESSIVE)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return 1
C.visible_message("<span class='danger'>[user] bashes [C]'s head in [src]'s door!</span>", \
"<span class='userdanger'>[user] bashes your head in [src]'s door! It feels rather hot in the oven!</span>")
if(!C.stat)
C.emote("scream")
user.changeNext_move(CLICK_CD_MELEE)
C.apply_damage(5, BURN, "head") //5 fire damage, 15 brute damage, and weakening because your head was just in a hot oven with the door bashing into your neck!
C.apply_damage(15, BRUTE, "head")
C.Weaken(2)
add_logs(G.assailant, G.affecting, "head smashed in oven")
qdel(O) //Removes the grip to prevent rapid bashes. With the weaken, you PROBABLY can't run unless they are slow to grab you again...
return 1
if(istype(src, /obj/machinery/kitchen_machine/grill))
if(G.state < GRAB_AGGRESSIVE)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return 1
C.visible_message("<span class='danger'>[user] forces [C] onto [src], searing [C]'s upper body!</span>", \
"<span class='userdanger'>[user] forces you onto [src]! It burns!</span>")
if(!C.stat)
C.emote("scream")
user.changeNext_move(CLICK_CD_MELEE)
C.apply_damage(10, BURN, "head") //30 overall upper body damage because your body was just placed over a hot grill!
C.apply_damage(10, BURN, "chest")
C.apply_damage(5, BURN, "l_arm")
C.apply_damage(5, BURN, "r_arm")
add_logs(G.assailant, G.affecting, "burns on a grill")
qdel(O) //Removes the grip to prevent rapid sears and give you a chance to run
return 1
return 1
else
to_chat(user, "<span class='warning'>You can only harm carbon-based creatures this way!</span>")
return 1
return special_attack(O, user)
else
to_chat(user, "<span class='alert'>You have no idea what you can cook with this [O].</span>")
return 1
@@ -222,6 +168,10 @@
user.set_machine(src)
interact(user)
/obj/machinery/kitchen_machine/proc/special_attack(obj/item/weapon/grab/G, mob/user)
to_chat(user, "<span class='alert'>This is ridiculous. You can not fit \the [G.affecting] in this [src].</span>")
return 0
/********************
* Machine Menu *
********************/
@@ -43,3 +43,29 @@
for(var/obj/item/weapon/stock_parts/micro_laser/M in component_parts)
E += M.rating
efficiency = round((E/2), 1) // There's 2 lasers, so halve the effect on the efficiency to keep it balanced
/obj/machinery/kitchen_machine/oven/special_attack(obj/item/weapon/grab/G, mob/user)
if(istype(G.affecting, /mob/living/carbon/human))
if(G.state < GRAB_AGGRESSIVE)
to_chat(user, "<span class='warning'>You need a better grip to do that!</span>")
return 1
var/mob/living/carbon/human/C = G.affecting
var/obj/item/organ/external/head/head = C.get_organ("head")
if(!head)
to_chat(user, "<span class='warning'>This person doesn't have a head!</span>")
return 1
C.visible_message("<span class='danger'>[user] bashes [C]'s head in [src]'s door!</span>", \
"<span class='userdanger'>[user] bashes your head in [src]'s door! It feels rather hot in the oven!</span>")
if(!C.stat)
C.emote("scream")
user.changeNext_move(CLICK_CD_MELEE)
if(!(head.status & ORGAN_ROBOT))
C.apply_damage(5, BURN, "head") //5 fire damage, 15 brute damage, and weakening because your head was just in a hot oven with the door bashing into your neck!
C.apply_damage(15, BRUTE, "head")
C.Weaken(2)
add_logs(G.assailant, G.affecting, "head smashed in oven")
qdel(G) //Removes the grip to prevent rapid bashes. With the weaken, you PROBABLY can't run unless they are slow to grab you again...
return 1
else
to_chat(user, "<span class='warning'>You can only harm carbon-based creatures this way!</span>")
return 0