Mob refactoring.

Updates Bump() code.
Intents now use constants.
Simple animals can now use languages without overriding say().
There is now a difference between being able to smash normal and reinforced walls.
Reworks simple_animal/attackby so that constructs don't need to override it simply to add damage resistance.
This commit is contained in:
PsiOmega
2015-03-29 10:44:31 +02:00
parent ab0ffe7767
commit 464d702d4b
84 changed files with 1314 additions and 1607 deletions
+6 -6
View File
@@ -873,11 +873,11 @@
var/phrase = "I don't want to exist anymore!"
/obj/structure/plushie/attack_hand(mob/user)
if(user.a_intent == "help")
if(user.a_intent == I_HELP)
user.visible_message("<span class='notice'><b>[user]</b> hugs [src]!</span>","<span class='notice'>You hug [src]!</span>")
else if (user.a_intent == "hurt")
else if (user.a_intent == I_HURT)
user.visible_message("<span class='warning'><b>[user]</b> punches [src]!</span>","<span class='warning'>You punch [src]!</span>")
else if (user.a_intent == "grab")
else if (user.a_intent == I_GRAB)
user.visible_message("<span class='warning'><b>[user]</b> attempts to strangle [src]!</span>","<span class='warning'>You attempt to strangle [src]!</span>")
else
user.visible_message("<span class='notice'><b>[user]</b> pokes the [src].</span>","<span class='notice'>You poke the [src].</span>")
@@ -915,11 +915,11 @@
icon_state = "nymphplushie"
/obj/item/toy/plushie/attack_self(mob/user as mob)
if(user.a_intent == "help")
if(user.a_intent == I_HELP)
user.visible_message("<span class='notice'><b>[user]</b> hugs [src]!</span>","<span class='notice'>You hug [src]!</span>")
else if (user.a_intent == "hurt")
else if (user.a_intent == I_HURT)
user.visible_message("<span class='warning'><b>[user]</b> punches [src]!</span>","<span class='warning'>You punch [src]!</span>")
else if (user.a_intent == "grab")
else if (user.a_intent == I_GRAB)
user.visible_message("<span class='warning'><b>[user]</b> attempts to strangle [src]!</span>","<span class='warning'>You attempt to strangle [src]!</span>")
else
user.visible_message("<span class='notice'><b>[user]</b> pokes the [src].</span>","<span class='notice'>You poke the [src].</span>")
+1 -1
View File
@@ -74,7 +74,7 @@ var/last_chew = 0
var/mob/living/carbon/human/H = A
if (!H.handcuffed) return
if (H.a_intent != "hurt") return
if (H.a_intent != I_HURT) return
if (H.zone_sel.selecting != "mouth") return
if (H.wear_mask) return
if (istype(H.wear_suit, /obj/item/clothing/suit/straight_jacket)) return
+1 -1
View File
@@ -40,7 +40,7 @@
if(!istype(M))
return ..()
if(user.a_intent != "help")
if(user.a_intent != I_HELP)
if(user.zone_sel.selecting == "head" || user.zone_sel.selecting == "eyes")
if((CLUMSY in user.mutations) && prob(50))
M = user
@@ -125,7 +125,7 @@
breaktape(W, user)
/obj/item/tape/attack_hand(mob/user as mob)
if (user.a_intent == "help" && src.allowed(user))
if (user.a_intent == I_HELP && src.allowed(user))
user.show_viewers("\blue [user] lifts [src], allowing passage.")
crumple()
lifted = 1
@@ -137,7 +137,7 @@
/obj/item/tape/proc/breaktape(obj/item/weapon/W as obj, mob/user as mob)
if(user.a_intent == "help" && ((!can_puncture(W) && src.allowed(user))))
if(user.a_intent == I_HELP && ((!can_puncture(W) && src.allowed(user))))
user << "You can't break the [src] with that!"
return
user.show_viewers("\blue [user] breaks the [src]!")
+1 -1
View File
@@ -113,7 +113,7 @@
var/mob/living/L = M
var/target_zone = check_zone(user.zone_sel.selecting)
if(user.a_intent == "hurt")
if(user.a_intent == I_HURT)
if (!..()) //item/attack() does it's own messaging and logs
return 0 // item/attack() will return 1 if they hit, 0 if they missed.
agony *= 0.5 //whacking someone causes a much poorer contact than prodding them.
@@ -41,7 +41,7 @@
log_attack("<font color='red'>[user.name] ([user.ckey]) attacked [M.name] ([M.ckey]) with [src.name] (INTENT: [uppertext(user.a_intent)])</font>")
*/
if (user.a_intent == "hurt")
if (user.a_intent == I_HURT)
if(!..()) return
//playsound(src.loc, "swing_hit", 50, 1, -1)
if (M.stuttering < 8 && (!(HULK in M.mutations)) /*&& (!istype(H:wear_suit, /obj/item/clothing/suit/judgerobe))*/)
+1 -1
View File
@@ -460,7 +460,7 @@
var/datum/organ/external/S = M:organs_by_name[user.zone_sel.selecting]
if (!S) return
if(!(S.status & ORGAN_ROBOT) || user.a_intent != "help")
if(!(S.status & ORGAN_ROBOT) || user.a_intent != I_HELP)
return ..()
if(istype(M,/mob/living/carbon/human))
@@ -137,10 +137,10 @@
..()
if(!buckled_mob) return
if(propelled || (pulling && (pulling.a_intent == "hurt")))
if(propelled || (pulling && (pulling.a_intent == I_HURT)))
var/mob/living/occupant = unbuckle_mob()
if (pulling && (pulling.a_intent == "hurt"))
if (pulling && (pulling.a_intent == I_HURT))
occupant.throw_at(A, 3, 3, pulling)
else if (propelled)
occupant.throw_at(A, 3, propelled)
+1 -1
View File
@@ -363,7 +363,7 @@
if (istype(G.affecting, /mob/living))
var/mob/living/M = G.affecting
if (G.state < 2)
if(user.a_intent == "hurt")
if(user.a_intent == I_HURT)
if (prob(15)) M.Weaken(5)
M.apply_damage(8,def_zone = "head")
visible_message("<span class='danger'>[G.assailant] slams [G.affecting]'s face against \the [src]!</span>")
+1 -1
View File
@@ -180,7 +180,7 @@
user.visible_message("<span class='danger'>[user] smashes through [src]!</span>")
shatter()
else if (usr.a_intent == "hurt")
else if (usr.a_intent == I_HURT)
if (istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/H = usr