mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
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:
@@ -195,7 +195,7 @@
|
||||
*/
|
||||
/mob/proc/RangedAttack(var/atom/A, var/params)
|
||||
if(!mutations.len) return
|
||||
if((LASER in mutations) && a_intent == "harm")
|
||||
if((LASER in mutations) && a_intent == I_HURT)
|
||||
LaserEyes(A) // moved into a proc below
|
||||
else if(TK in mutations)
|
||||
switch(get_dist(src,A))
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,ico.Height()/2,ico.Width()/2,ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "help"
|
||||
using.name = I_HELP
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.alpha = ui_alpha
|
||||
@@ -89,7 +89,7 @@
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,ico.Height()/2,ico.Width(),ico.Height())
|
||||
using = new /obj/screen( src )
|
||||
using.name = "disarm"
|
||||
using.name = I_DISARM
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.alpha = ui_alpha
|
||||
@@ -101,7 +101,7 @@
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),ico.Width()/2,1,ico.Width(),ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "grab"
|
||||
using.name = I_GRAB
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.alpha = ui_alpha
|
||||
@@ -113,7 +113,7 @@
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "harm"
|
||||
using.name = I_HURT
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_acti
|
||||
using.alpha = ui_alpha
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
using.name = "act_intent"
|
||||
using.set_dir(SOUTHWEST)
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
|
||||
using.icon_state = (mymob.a_intent == I_HURT ? I_HURT : mymob.a_intent)
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
|
||||
@@ -90,7 +90,7 @@
|
||||
ico.MapColors(0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0, -1,-1,-1,-1)
|
||||
ico.DrawBox(rgb(255,255,255,1),1,1,ico.Width()/2,ico.Height()/2)
|
||||
using = new /obj/screen( src )
|
||||
using.name = "harm"
|
||||
using.name = I_HURT
|
||||
using.icon = ico
|
||||
using.screen_loc = ui_zonesel
|
||||
using.layer = 21
|
||||
@@ -100,4 +100,4 @@
|
||||
mymob.client.screen = null
|
||||
mymob.client.screen += src.adding
|
||||
|
||||
return
|
||||
return
|
||||
|
||||
@@ -57,7 +57,7 @@ var/obj/screen/robot_inventory
|
||||
using.name = "act_intent"
|
||||
using.set_dir(SOUTHWEST)
|
||||
using.icon = 'icons/mob/screen1_robot.dmi'
|
||||
using.icon_state = (mymob.a_intent == "hurt" ? "harm" : mymob.a_intent)
|
||||
using.icon_state = (mymob.a_intent == I_HURT ? I_HURT : mymob.a_intent)
|
||||
using.screen_loc = ui_acti
|
||||
using.layer = 20
|
||||
src.adding += using
|
||||
|
||||
@@ -360,17 +360,17 @@
|
||||
C << "<span class='notice'>You don't have a[breathes=="oxygen" ? "n oxygen" : addtext(" ",breathes)] tank.</span>"
|
||||
if("act_intent")
|
||||
usr.a_intent_change("right")
|
||||
if("help")
|
||||
usr.a_intent = "help"
|
||||
if(I_HELP)
|
||||
usr.a_intent = I_HELP
|
||||
usr.hud_used.action_intent.icon_state = "intent_help"
|
||||
if("harm")
|
||||
usr.a_intent = "hurt"
|
||||
if(I_HURT)
|
||||
usr.a_intent = I_HURT
|
||||
usr.hud_used.action_intent.icon_state = "intent_hurt"
|
||||
if("grab")
|
||||
usr.a_intent = "grab"
|
||||
if(I_GRAB)
|
||||
usr.a_intent = I_GRAB
|
||||
usr.hud_used.action_intent.icon_state = "intent_grab"
|
||||
if("disarm")
|
||||
usr.a_intent = "disarm"
|
||||
if(I_DISARM)
|
||||
usr.a_intent = I_DISARM
|
||||
usr.hud_used.action_intent.icon_state = "intent_disarm"
|
||||
|
||||
if("pull")
|
||||
|
||||
@@ -347,7 +347,7 @@
|
||||
src.hand_al(usr, usr.hand)
|
||||
else
|
||||
// ------- YOU ARE CLICKING ON AN OBJECT THAT'S INACCESSIBLE TO YOU AND IS NOT YOUR HUD -------
|
||||
if((LASER in usr:mutations) && usr:a_intent == "harm" && world.time >= usr.next_move)
|
||||
if((LASER in usr:mutations) && usr:a_intent == I_HURT && world.time >= usr.next_move)
|
||||
// ------- YOU HAVE THE LASER MUTATION, YOUR INTENT SET TO HURT AND IT'S BEEN MORE THAN A DECISECOND SINCE YOU LAS TATTACKED -------
|
||||
|
||||
var/turf/T = get_turf(usr)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
/mob/living/carbon/human/RangedAttack(var/atom/A)
|
||||
if(!gloves && !mutations.len) return
|
||||
var/obj/item/clothing/gloves/G = gloves
|
||||
if((LASER in mutations) && a_intent == "hurt")
|
||||
if((LASER in mutations) && a_intent == I_HURT)
|
||||
LaserEyes(A) // moved into a proc below
|
||||
|
||||
else if(istype(G) && G.Touch(A,0)) // for magic gloves
|
||||
@@ -89,9 +89,9 @@
|
||||
if (istype(M))
|
||||
|
||||
switch(src.a_intent)
|
||||
if ("help") // We just poke the other
|
||||
if (I_HELP) // We just poke the other
|
||||
M.visible_message("<span class='notice'>[src] gently pokes [M]!</span>", "<span class='notice'>[src] gently pokes you!</span>")
|
||||
if ("disarm") // We stun the target, with the intention to feed
|
||||
if (I_DISARM) // We stun the target, with the intention to feed
|
||||
var/stunprob = 1
|
||||
var/power = max(0, min(10, (powerlevel + rand(0, 3))))
|
||||
if (powerlevel > 0 && !istype(A, /mob/living/carbon/slime))
|
||||
@@ -130,9 +130,9 @@
|
||||
else
|
||||
M.visible_message("<span class='danger'>[src] has tried to pounce at [M]!</span>", "<span class='danger'>[src] has tried to pounce at you!</span>")
|
||||
M.updatehealth()
|
||||
if ("grab") // We feed
|
||||
if (I_GRAB) // We feed
|
||||
Wrap(M)
|
||||
if ("hurt") // Attacking
|
||||
if (I_HURT) // Attacking
|
||||
A.attack_generic(src, (is_adult ? rand(20,40) : rand(5,25)), "glomped")
|
||||
else
|
||||
A.attack_generic(src, (is_adult ? rand(20,40) : rand(5,25)), "glomped") // Basic attack.
|
||||
@@ -156,5 +156,5 @@
|
||||
return
|
||||
|
||||
var/damage = rand(melee_damage_lower, melee_damage_upper)
|
||||
if(A.attack_generic(src,damage,attacktext,wall_smash) && loc && attack_sound)
|
||||
playsound(loc, attack_sound, 50, 1, 1)
|
||||
if(A.attack_generic(src,damage,attacktext,environment_smash) && loc && attack_sound)
|
||||
playsound(loc, attack_sound, 50, 1, 1)
|
||||
|
||||
Reference in New Issue
Block a user