mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
The Combat Code Cleanup Part 1 (#13061)
* Combat code upgrade * Fix * Runtimes goodbye * MORE improvements * Monkey combat code * Done for today * Stun gloves refactor * New day new code * Remove debug * Logs stunglove * Slimes * Slime attack sound * Better logging * Better way to do this
This commit is contained in:
@@ -7,12 +7,6 @@
|
||||
/mob/living/carbon/human/UnarmedAttack(var/atom/A, var/proximity, var/params)
|
||||
var/obj/item/clothing/gloves/G = gloves // not typecast specifically enough in defines
|
||||
|
||||
// Special glove functions:
|
||||
// If the gloves do anything, have them return 1 to stop
|
||||
// normal attack_hand() here.
|
||||
if(proximity && istype(G) && G.Touch(A, src, 1))
|
||||
return
|
||||
|
||||
if(a_intent == "hurt" && A.loc != src)
|
||||
var/special_attack_result = SPECIAL_ATTACK_SUCCESS
|
||||
switch(attack_type) //Special attacks - kicks, bites
|
||||
@@ -44,6 +38,12 @@
|
||||
else
|
||||
set_attack_type() //Reset attack type
|
||||
|
||||
// Special glove functions:
|
||||
// If the gloves do anything, have them return 1 to stop
|
||||
// normal attack_hand() here.
|
||||
if(proximity && istype(G) && G.Touch(A, src, 1))
|
||||
return
|
||||
|
||||
if(ismob(A))
|
||||
delayNextAttack(10)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
icobase = 'icons/mob/human_races/r_horror.dmi'
|
||||
deform = 'icons/mob/human_races/r_horror.dmi' // TODO: Need deform.
|
||||
known_languages = list(LANGUAGE_CLATTER)
|
||||
attack_verb = "smashes"
|
||||
attack_verb = "smashed"
|
||||
flags = NO_BREATHE /*| NON_GENDERED*/ | NO_PAIN
|
||||
pressure_resistance = 30 * ONE_ATMOSPHERE /*No longer will our ascent be foiled by depressurization!*/
|
||||
//h_style = null
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
icon_state = "boxing"
|
||||
item_state = "boxingred"
|
||||
species_fit = list(VOX_SHAPED)
|
||||
bonus_knockout = 1 //Increase knockout chance from 1/12 to 1/6
|
||||
bonus_knockout = 12
|
||||
|
||||
/obj/item/clothing/gloves/boxing/dexterity_check()
|
||||
return 0 //Wearing boxing gloves makes you less dexterious (so, for example, you can't use computers)
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
item_state = "knuckles"
|
||||
|
||||
attack_verb = list("punches")
|
||||
bonus_knockout = 2 //Slight knockout chance increase.
|
||||
bonus_knockout = 17 //Slight knockout chance increase.
|
||||
damage_added = 3 //Add 3 damage to unarmed attacks when worn
|
||||
force = 5 //Deal 5 damage if hit with this item in hand
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
icon_state = "knuckles_spiked"
|
||||
item_state = "knuckles_spiked"
|
||||
|
||||
bonus_knockout = 3
|
||||
bonus_knockout = 25
|
||||
damage_added = 5
|
||||
force = 7
|
||||
|
||||
|
||||
@@ -59,3 +59,31 @@
|
||||
if(ishuman(src.loc))
|
||||
var/mob/living/carbon/human/H = src.loc
|
||||
H.update_inv_gloves()
|
||||
|
||||
/obj/item/clothing/gloves/Touch(atom/A, mob/living/user, prox)
|
||||
if(!isliving(A))
|
||||
return
|
||||
if(!cell)
|
||||
return
|
||||
|
||||
var/mob/living/L = A
|
||||
if(user.a_intent == I_HURT)//Stungloves. Any contact will stun the alien.
|
||||
visible_message("<span class='danger'>\The [A] has been touched with the stun gloves by [user]!</span>")
|
||||
|
||||
if(cell.charge >= 2500)
|
||||
cell.charge -= 2500
|
||||
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Stungloved [L.name] ([L.ckey])</font>")
|
||||
L.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stungloved by [user.name] ([user.ckey])</font>")
|
||||
L.LAssailant = user
|
||||
|
||||
log_attack("<font color='red'>[user] ([user.ckey]) stungloved [L.name] ([L.ckey])</font>")
|
||||
|
||||
var/armorblock = L.run_armor_check(user.zone_sel.selecting, "energy")
|
||||
L.apply_effects(5,5,0,0,5,0,0,armorblock)
|
||||
|
||||
else
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Unsuccessfully stungloved [L.name] ([L.ckey])</font>")
|
||||
L.attack_log += text("\[[time_stamp()]\] <font color='orange'>Victim of an unsuccessful stunglove by [user.name] ([user.ckey])</font>")
|
||||
log_attack("<font color='red'>[user] ([user.ckey]) unsuccessfully stungloved [L.name] ([L.ckey])</font>")
|
||||
to_chat(user, "<span class='warning'>Not enough charge!</span>")
|
||||
|
||||
@@ -61,6 +61,28 @@
|
||||
*/
|
||||
//No longer weak to fire
|
||||
|
||||
/*Code for aliens attacking aliens. Because aliens act on a hivemind, I don't see them as very aggressive with each other.
|
||||
As such, they can either help or harm other aliens. Help works like the human help command while harm is a simple nibble.
|
||||
In all, this is a lot like the monkey code. /N
|
||||
*/
|
||||
|
||||
/mob/living/carbon/alien/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if(I_HELP)
|
||||
sleeping = max(0,sleeping-5)
|
||||
resting = 0
|
||||
AdjustParalysis(-3)
|
||||
AdjustStunned(-3)
|
||||
AdjustKnockdown(-3)
|
||||
visible_message("<span class='notice'>[M] nuzzles [src] trying to wake it up !</span>")
|
||||
if(I_GRAB)
|
||||
M.grab_mob(src)
|
||||
else
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/carbon/alien/proc/getPlasma()
|
||||
return plasma
|
||||
|
||||
|
||||
55
code/modules/mob/living/carbon/alien/humanoid/combat.dm
Normal file
55
code/modules/mob/living/carbon/alien/humanoid/combat.dm
Normal file
@@ -0,0 +1,55 @@
|
||||
/mob/living/carbon/alien/humanoid/disarm_mob(mob/living/target)
|
||||
if(target.disarmed_by(src))
|
||||
return
|
||||
|
||||
if(prob(80))
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
target.Knockdown(rand(3,4))
|
||||
|
||||
visible_message("<span class='danger'>[src] has tackled down [target]!</span>")
|
||||
|
||||
else if (prob(80))
|
||||
playsound(loc, get_unarmed_hit_sound(), 25, 1, -1)
|
||||
target.drop_item()
|
||||
break_pulls(target)
|
||||
break_grabs(target)
|
||||
visible_message("<span class='danger'>[src] has disarmed [target]!</span>")
|
||||
else
|
||||
playsound(loc, get_unarmed_miss_sound(), 50, 1, -1)
|
||||
visible_message("<span class='danger'>[src] has tried to disarm [target]!</span>")
|
||||
|
||||
/mob/living/carbon/alien/humanoid/get_unarmed_hit_sound()
|
||||
return 'sound/weapons/slash.ogg'
|
||||
|
||||
/mob/living/carbon/alien/humanoid/get_unarmed_miss_sound()
|
||||
return 'sound/weapons/slashmiss.ogg'
|
||||
|
||||
/mob/living/carbon/alien/humanoid/get_unarmed_verb(mob/living/target)
|
||||
if(isalien(target))
|
||||
return "bit"
|
||||
|
||||
return "slashed at"
|
||||
|
||||
/mob/living/carbon/alien/humanoid/get_unarmed_damage(mob/living/target)
|
||||
if(isalien(target))
|
||||
return rand(1,3)
|
||||
|
||||
if(prob(5)) //5% miss chance
|
||||
return 0
|
||||
|
||||
return rand(15,30)
|
||||
|
||||
/mob/living/carbon/alien/humanoid/unarmed_attack_mob(mob/living/target)
|
||||
if(isalien(target))
|
||||
var/mob/living/carbon/alien/A = target
|
||||
if(A.health <= 0)
|
||||
to_chat(src, "<span class='alien'>[target] is too injured for that.</span>")
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/alien/humanoid/after_unarmed_attack(mob/living/target, damage, damage_type, organ, armor)
|
||||
if(iscarbon(target) && !isslime(target))
|
||||
if(damage > 25)
|
||||
visible_message("<span class='danger'>[src] has wounded [target]!</span>")
|
||||
target.apply_effect(rand(0.5,3), WEAKEN, armor)
|
||||
@@ -100,19 +100,10 @@
|
||||
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/humanoid/attack_paw(mob/living/carbon/monkey/M as mob)
|
||||
/mob/living/carbon/alien/humanoid/attack_paw(mob/living/carbon/monkey/M)
|
||||
if(!ismonkey(M))
|
||||
return//Fix for aliens receiving double messages when attacking other aliens.
|
||||
|
||||
if(!ticker)
|
||||
to_chat(M, "<span class='warning'>You cannot attack people before the game has started.</span>")
|
||||
return
|
||||
|
||||
/*
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "No attacking people at spawn, you jackass.")
|
||||
return
|
||||
*/
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
@@ -120,158 +111,33 @@
|
||||
if(I_HELP)
|
||||
help_shake_act(M)
|
||||
else
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
return
|
||||
if(health > 0)
|
||||
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>\The [M] has bit \the [src]!</span>")
|
||||
adjustBruteLoss(rand(1, 3))
|
||||
updatehealth()
|
||||
M.unarmed_attack_mob(src)
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/attack_slime(mob/living/carbon/slime/M as mob)
|
||||
if(!ticker)
|
||||
to_chat(M, "<span class='warning'>You cannot attack people before the game has started.</span>")
|
||||
return
|
||||
|
||||
if(M.Victim)
|
||||
return // can't attack while eating!
|
||||
|
||||
if(health > -100)
|
||||
visible_message("<span class='danger'>\The [M] glomps [src]!</span>")
|
||||
add_logs(M, src, "glomped on", 0)
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(M, /mob/living/carbon/slime/adult))
|
||||
damage = rand(10, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
|
||||
adjustBruteLoss(damage)
|
||||
|
||||
if(M.powerlevel > 0)
|
||||
var/stunprob = 10
|
||||
var/power = M.powerlevel + rand(0,3)
|
||||
|
||||
switch(M.powerlevel)
|
||||
if(1 to 2)
|
||||
stunprob = 20
|
||||
if(3 to 4)
|
||||
stunprob = 30
|
||||
if(5 to 6)
|
||||
stunprob = 40
|
||||
if(7 to 8)
|
||||
stunprob = 60
|
||||
if(9)
|
||||
stunprob = 70
|
||||
if(10)
|
||||
stunprob = 95
|
||||
|
||||
if(prob(stunprob))
|
||||
M.powerlevel -= 3
|
||||
if(M.powerlevel < 0)
|
||||
M.powerlevel = 0
|
||||
visible_message("<span class='danger'>\The [M] has shocked [src]!</span>")
|
||||
|
||||
Knockdown(power)
|
||||
if(stuttering < power)
|
||||
stuttering = power
|
||||
Stun(power)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
if(prob(stunprob) && M.powerlevel >= 8)
|
||||
adjustFireLoss(M.powerlevel * rand(6,10))
|
||||
|
||||
updatehealth()
|
||||
return
|
||||
/mob/living/carbon/alien/humanoid/attack_slime(mob/living/carbon/slime/M)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
//using the default attack_animal() in carbon.dm
|
||||
|
||||
/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M as mob)
|
||||
/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M)
|
||||
|
||||
..()
|
||||
|
||||
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
|
||||
var/obj/item/clothing/gloves/G = M.gloves
|
||||
if(G.cell)
|
||||
if(M.a_intent == I_HURT)//Stungloves. Any contact will stun the alien.
|
||||
if(G.cell.charge >= 2500)
|
||||
G.cell.charge -= 2500
|
||||
|
||||
Knockdown(5)
|
||||
if(stuttering < 5)
|
||||
stuttering = 5
|
||||
Stun(5)
|
||||
visible_message("<span class='danger'>\The [src] has been touched with the stun gloves by [M] !</span>")
|
||||
return
|
||||
else
|
||||
to_chat(M, "<span class='warning'>Not enough charge !</span>")
|
||||
return
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if(I_HELP)
|
||||
if(health >= config.health_threshold_crit)
|
||||
help_shake_act(M)
|
||||
return 1
|
||||
else
|
||||
if(M.check_body_part_coverage(MOUTH))
|
||||
to_chat(M, "<span class='notice'><B>Remove your [M.get_body_part_coverage(MOUTH)]!</B></span>")
|
||||
return 0
|
||||
|
||||
if (!cpr_time)
|
||||
return 0
|
||||
|
||||
M.visible_message("<span class='danger'>\The [M] is trying perform CPR on \the [src]!</span>")
|
||||
|
||||
cpr_time = 0
|
||||
if(do_after(M, src, 3 SECONDS))
|
||||
adjustOxyLoss(-min(getOxyLoss(), 7))
|
||||
M.visible_message("<span class='danger'>\The [M] performs CPR on \the [src]!</span>")
|
||||
to_chat(src, "<span class='notice'>You feel a breath of fresh air enter your lungs. It feels good.</span>")
|
||||
to_chat(M, "<span class='warning'>Repeat at least every 7 seconds.</span>")
|
||||
cpr_time = 1
|
||||
else if(ishuman(M))
|
||||
M.perform_cpr(src)
|
||||
|
||||
if(I_GRAB)
|
||||
if(M.grab_check(src))
|
||||
return
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M, src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("<span class='warning'>[M] has grabbed \the [src] passively!</span>")
|
||||
return M.grab_mob(src)
|
||||
|
||||
if(I_HURT)
|
||||
var/damage = rand(1, 9)
|
||||
if(prob(90))
|
||||
if(M_HULK in M.mutations) //M_HULK SMASH
|
||||
damage += 14
|
||||
spawn(0)
|
||||
Knockdown(damage) //Why can a hulk knock an alien out but not knock out a human? Damage is robust enough.
|
||||
step_away(src, M, 15)
|
||||
sleep(3)
|
||||
step_away(src, M, 15)
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has punched \the [src] !</span>")
|
||||
if(damage > 9 ||prob(5))//Regular humans have a very small chance of weakening an alien.
|
||||
Knockdown(1, 5)
|
||||
visible_message("<span class='danger'>[M] has knockdown \the [src] !</span>")
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to punch \the [src] !</span>")
|
||||
return M.unarmed_attack_mob(src)
|
||||
|
||||
if(I_DISARM)
|
||||
if(!lying)
|
||||
@@ -289,34 +155,6 @@
|
||||
visible_message("<span class='danger'>[M] has attempted to disarm \the [src] !</span>")
|
||||
return
|
||||
|
||||
/*Code for aliens attacking aliens. Because aliens act on a hivemind, I don't see them as very aggressive with each other.
|
||||
As such, they can either help or harm other aliens. Help works like the human help command while harm is a simple nibble.
|
||||
In all, this is a lot like the monkey code. /N
|
||||
*/
|
||||
|
||||
/mob/living/carbon/alien/humanoid/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if(I_HELP)
|
||||
sleeping = max(0,sleeping-5)
|
||||
resting = 0
|
||||
AdjustParalysis(-3)
|
||||
AdjustStunned(-3)
|
||||
AdjustKnockdown(-3)
|
||||
visible_message("<span class='notice'>[M] nuzzles [src] trying to wake it up !</span>")
|
||||
else
|
||||
if(health > 0)
|
||||
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
|
||||
var/damage = rand(1, 3)
|
||||
visible_message("<span class='danger'>\The [M] has bit [src]!</span>")
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
to_chat(M, "<span class='alien'>[name] is too injured for that.</span>")
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/alien/humanoid/restrained()
|
||||
if(timestopped)
|
||||
|
||||
@@ -101,20 +101,10 @@
|
||||
|
||||
//using the default attack_animal() in carbon.dm
|
||||
|
||||
/mob/living/carbon/alien/larva/attack_paw(mob/living/carbon/monkey/M as mob)
|
||||
/mob/living/carbon/alien/larva/attack_paw(mob/living/carbon/monkey/M)
|
||||
if(!(istype(M, /mob/living/carbon/monkey)))
|
||||
return //Fix for aliens receiving double messages when attacking other aliens.
|
||||
|
||||
if(!ticker)
|
||||
to_chat(M, "<span class='warning'>You cannot attack people before the game has started.</span>")
|
||||
return
|
||||
|
||||
/*
|
||||
//MUH SPAWN PROTECTION
|
||||
if(istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "<span class='warning'>No attacking people at spawn, you jackass.</span>")
|
||||
return
|
||||
*/
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
@@ -122,148 +112,27 @@
|
||||
if(I_HELP)
|
||||
help_shake_act(M)
|
||||
else
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
return
|
||||
if(health > 0)
|
||||
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>\The [M] has bit \the [src] !</span>")
|
||||
adjustBruteLoss(rand(1, 3))
|
||||
updatehealth()
|
||||
M.unarmed_attack_mob(src)
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/alien/larva/attack_slime(mob/living/carbon/slime/M as mob)
|
||||
if(!ticker)
|
||||
to_chat(M, "<span class='warning'>You cannot attack people before the game has started.</span>")
|
||||
return
|
||||
/mob/living/carbon/alien/larva/attack_slime(mob/living/carbon/slime/M)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
if(M.Victim)
|
||||
return // can't attack while eating!
|
||||
/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M)
|
||||
|
||||
if(health > -100)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
visible_message("<span class='danger'>\The [M] glomps \the [src]!</span>")
|
||||
|
||||
add_logs(M, src, "glomped on", 0)
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
damage = rand(20, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
|
||||
adjustBruteLoss(damage)
|
||||
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M as mob)
|
||||
if(!ticker)
|
||||
to_chat(M, "<span class='warning'>You cannot attack people before the game has started.</span>")
|
||||
return
|
||||
|
||||
/*
|
||||
if(istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "<span class='warning'>No attacking people at spawn, you jackass.</span>")
|
||||
return
|
||||
*/
|
||||
..()
|
||||
|
||||
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
|
||||
var/obj/item/clothing/gloves/G = M.gloves
|
||||
if(G.cell)
|
||||
if(M.a_intent == I_HURT)//Stungloves. Any contact will stun the alien.
|
||||
if(G.cell.charge >= 2500)
|
||||
G.cell.use(2500)
|
||||
|
||||
Knockdown(5)
|
||||
if(stuttering < 5)
|
||||
stuttering = 5
|
||||
Stun(5)
|
||||
|
||||
visible_message("<span class='danger'>\The [src] has been touched with the stun gloves by [M] !</span>")
|
||||
return
|
||||
else
|
||||
to_chat(M, "<span class='warning'>Not enough charge !</span>")
|
||||
return
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if(I_HELP)
|
||||
help_shake_act(M)
|
||||
|
||||
if(I_GRAB)
|
||||
if(M.grab_check(src))
|
||||
return
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M,src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("<span class='warning'>[M] has grabbed \the [src] passively !</span>")
|
||||
M.grab_mob(src)
|
||||
|
||||
else
|
||||
var/damage = rand(1, 9)
|
||||
if(prob(90))
|
||||
if(M_HULK in M.mutations)
|
||||
damage += 5
|
||||
spawn(0)
|
||||
Paralyse(1)
|
||||
step_away(src,M,15)
|
||||
sleep(3)
|
||||
step_away(src,M,15)
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has punched \the [src] !</span>")
|
||||
if(damage > 4.9)
|
||||
Knockdown(rand(10,15))
|
||||
visible_message("<span class='danger'>[M] has knocked down \the [src] !</span>")
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has attempted to punch \the [src] !</span>")
|
||||
return
|
||||
|
||||
/mob/living/carbon/alien/larva/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if(!ticker)
|
||||
to_chat(M, "<span class='warning'>You cannot attack people before the game has started.</span>")
|
||||
return
|
||||
|
||||
/*
|
||||
if(istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "<span class='warning'>No attacking people at spawn, you jackass.</span>")
|
||||
return
|
||||
*/
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if(I_HELP)
|
||||
sleeping = max(0,sleeping-5)
|
||||
resting = 0
|
||||
AdjustParalysis(-3)
|
||||
AdjustStunned(-3)
|
||||
AdjustKnockdown(-3)
|
||||
visible_message("<span class='notice'>[M.name] nuzzles [src] trying to wake it up !</span>")
|
||||
|
||||
else
|
||||
if(health > 0)
|
||||
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
|
||||
var/damage = rand(1, 3)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[M.name] has bit []!</span>", src), 1)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
to_chat(M, "<span class='alien'>[name] is too injured for that.</span>")
|
||||
return
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/carbon/alien/larva/restrained()
|
||||
if(timestopped)
|
||||
|
||||
@@ -23,24 +23,7 @@
|
||||
update_minimap()
|
||||
|
||||
/mob/living/carbon/attack_animal(mob/living/simple_animal/M as mob)//humans and slimes have their own
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
if(M.attack_sound)
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
visible_message("<span class='warning'><B>[M]</B> [M.attacktext] \the [src] !</span>")
|
||||
|
||||
add_logs(M, src, "attacked", admin = M.ckey ? TRUE : FALSE) //Only add this to the server logs if they're controlled by a player.
|
||||
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
var/dam_zone = pick(LIMB_CHEST, LIMB_LEFT_HAND, LIMB_RIGHT_HAND, LIMB_LEFT_LEG, LIMB_RIGHT_LEG)
|
||||
if(M.zone_sel && M.zone_sel.selecting)
|
||||
dam_zone = M.zone_sel.selecting
|
||||
var/datum/organ/external/affecting = ran_zone(dam_zone)
|
||||
|
||||
apply_damage(damage,M.melee_damage_type, affecting)
|
||||
updatehealth()
|
||||
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/carbon/proc/update_minimap()
|
||||
var/obj/item/device/pda/pda_device = machine
|
||||
@@ -106,13 +89,6 @@
|
||||
share_contact_diseases(M)
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/attack_paw(mob/M as mob)
|
||||
if(!istype(M, /mob/living/carbon))
|
||||
return
|
||||
share_contact_diseases(M)
|
||||
return
|
||||
|
||||
/mob/living/carbon/electrocute_act(const/shock_damage, const/obj/source, const/siemens_coeff = 1.0)
|
||||
var/damage = shock_damage * siemens_coeff
|
||||
|
||||
|
||||
5
code/modules/mob/living/carbon/combat.dm
Normal file
5
code/modules/mob/living/carbon/combat.dm
Normal file
@@ -0,0 +1,5 @@
|
||||
/mob/living/carbon/unarmed_attacked(mob/living/carbon/C)
|
||||
if(istype(C))
|
||||
share_contact_diseases(C)
|
||||
|
||||
return ..()
|
||||
173
code/modules/mob/living/carbon/human/combat.dm
Normal file
173
code/modules/mob/living/carbon/human/combat.dm
Normal file
@@ -0,0 +1,173 @@
|
||||
//#define COMBAT_STATS
|
||||
#ifdef COMBAT_STATS
|
||||
#define show_combat_stat(x) to_chat(usr, "[x]")
|
||||
#else
|
||||
#define show_combat_stat(x) null << x
|
||||
#endif
|
||||
|
||||
/mob/living/carbon/human/grabbed_by(mob/living/grabber)
|
||||
if(ishuman(grabber) && w_uniform)
|
||||
w_uniform.add_fingerprint(grabber)
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/disarmed_by(mob/living/disarmer)
|
||||
if(ishuman(disarmer) && w_uniform)
|
||||
w_uniform.add_fingerprint(disarmer)
|
||||
|
||||
for(var/obj/item/weapon/gun/G in held_items)
|
||||
var/index = is_holding_item(G)
|
||||
var/chance = (index == active_hand ? 40 : 20)
|
||||
|
||||
if(prob(chance))
|
||||
visible_message("<spawn class=danger>[G], held by [src], goes off during struggle!")
|
||||
var/list/turfs = list()
|
||||
for(var/turf/T in view())
|
||||
turfs += T
|
||||
var/turf/target = pick(turfs)
|
||||
return G.afterattack(target, src, "struggle" = 1)
|
||||
|
||||
/mob/living/carbon/human/disarm_mob(mob/living/target)
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='red'>Disarmed [target.name] ([target.ckey])</font>")
|
||||
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been disarmed by [src.name] ([src.ckey])</font>")
|
||||
|
||||
log_attack("[src.name] ([src.ckey]) disarmed [target.name] ([target.ckey])")
|
||||
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(zone_sel.selecting))
|
||||
if(target.disarmed_by(src))
|
||||
return
|
||||
|
||||
var/randn = rand(1, 100)
|
||||
if(randn <= 25)
|
||||
target.apply_effect(4, WEAKEN, run_armor_check(affecting, "melee"))
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>[src] has pushed [target]!</span>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='red'>Pushed [target.name] ([target.ckey])</font>")
|
||||
target.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been pushed by [src.name] ([src.ckey])</font>")
|
||||
|
||||
target.LAssailant = src
|
||||
|
||||
log_attack("[src.name] ([src.ckey]) pushed [target.name] ([target.ckey])")
|
||||
return
|
||||
|
||||
var/talked = 0
|
||||
|
||||
if(randn <= 60)
|
||||
//Disarming breaks pulls
|
||||
talked |= break_pulls(target)
|
||||
|
||||
//Disarming also breaks a grab - this will also stop someone being choked, won't it?
|
||||
talked |= break_grabs(target)
|
||||
|
||||
if(!talked)
|
||||
target.drop_item()
|
||||
visible_message("<span class='danger'>[src] has disarmed [target]!</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
return
|
||||
|
||||
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[src] has attempted to disarm [target]!</span>")
|
||||
|
||||
/mob/living/carbon/human/get_unarmed_verb()
|
||||
if(species)
|
||||
return species.attack_verb
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/get_unarmed_hit_sound()
|
||||
return (species.attack_verb == "punched" ? "punch" : 'sound/weapons/slice.ogg')
|
||||
|
||||
/mob/living/carbon/human/get_unarmed_miss_sound()
|
||||
return (species.attack_verb == "punched" ? 'sound/weapons/punchmiss.ogg' : 'sound/weapons/slashmiss.ogg')
|
||||
|
||||
/mob/living/carbon/human/get_unarmed_damage_type(mob/living/target)
|
||||
if(ishuman(target) && istype(gloves , /obj/item/clothing/gloves/boxing/hologlove))
|
||||
return HALLOSS
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/human/get_unarmed_damage()
|
||||
var/damage = rand(0, species.max_hurt_damage)
|
||||
damage += species.punch_damage
|
||||
|
||||
if(mutations.Find(M_HULK))
|
||||
damage += 5
|
||||
if(mutations.Find(M_CLAWS) && !istype(gloves))
|
||||
damage += 3
|
||||
if(istype(gloves))
|
||||
var/obj/item/clothing/gloves/G = gloves
|
||||
damage += G.damage_added //Increase damage by the gloves' damage modifier
|
||||
|
||||
return damage
|
||||
|
||||
/mob/living/carbon/human/proc/get_knockout_chance(mob/living/victim)
|
||||
var/base_chance = 8
|
||||
|
||||
if(mutations.Find(M_HULK))
|
||||
base_chance += 12
|
||||
if(istype(gloves))
|
||||
var/obj/item/clothing/gloves/G = gloves
|
||||
base_chance += G.bonus_knockout
|
||||
|
||||
if(isalien(victim))
|
||||
base_chance *= 0.25
|
||||
else if(ishuman(victim))
|
||||
base_chance *= 1
|
||||
else if(ismonkey(victim))
|
||||
base_chance *= 2
|
||||
else
|
||||
return 0
|
||||
|
||||
return base_chance
|
||||
|
||||
/mob/living/carbon/human/after_unarmed_attack(mob/living/target, damage, damage_type, organ, armor)
|
||||
var/knockout_chance = get_knockout_chance(target)
|
||||
|
||||
show_combat_stat("Knockout chance: [knockout_chance]")
|
||||
if(prob(knockout_chance))
|
||||
visible_message("<span class='danger'>[src] has knocked down \the [target]!</span>")
|
||||
target.apply_effect(2, WEAKEN, armor)
|
||||
|
||||
if(species.punch_throw_range && prob(25))
|
||||
target.visible_message("<span class='danger'>[target] is thrown by the force of the assault!</span>")
|
||||
var/turf/T = get_turf(target)
|
||||
var/turf/destination
|
||||
if(istype(T, /turf/space)) // if ended in space, then range is unlimited
|
||||
destination = get_edge_target_turf(T, src.dir)
|
||||
else // otherwise limit to 10 tiles
|
||||
destination = get_ranged_target_turf(T, src.dir, src.species.punch_throw_range)
|
||||
target.throw_at(destination, 100, src.species.punch_throw_speed)
|
||||
|
||||
/mob/living/carbon/human/unarmed_attacked(mob/living/attacker, damage, damage_type, zone)
|
||||
if(ishuman(attacker) && w_uniform)
|
||||
w_uniform.add_fingerprint(attacker)
|
||||
|
||||
if(zone == "head")
|
||||
var/chance = 0.5 * damage
|
||||
if(attacker.mutations.Find(M_HULK))
|
||||
chance += 50
|
||||
if(prob(chance))
|
||||
knock_out_teeth(attacker)
|
||||
|
||||
..()
|
||||
|
||||
/mob/living/carbon/human/proc/perform_cpr(mob/living/target)
|
||||
if(src.check_body_part_coverage(MOUTH))
|
||||
to_chat(src, "<span class='notice'><B>Remove your [src.get_body_part_coverage(MOUTH)]!</B></span>")
|
||||
return 0
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(H.check_body_part_coverage(MOUTH))
|
||||
to_chat(src, "<span class='notice'><B>Remove their [H.get_body_part_coverage(MOUTH)]!</B></span>")
|
||||
return 0
|
||||
|
||||
if(!target.cpr_time)
|
||||
return 0
|
||||
|
||||
src.visible_message("<span class='danger'>\The [src] is trying perform CPR on \the [target]!</span>")
|
||||
|
||||
target.cpr_time = 0
|
||||
if(do_after(src, target, 3 SECONDS))
|
||||
target.adjustOxyLoss(-min(target.getOxyLoss(), 7))
|
||||
src.visible_message("<span class='danger'>\The [src] performs CPR on \the [target]!</span>")
|
||||
to_chat(target, "<span class='notice'>You feel a breath of fresh air enter your lungs. It feels good.</span>")
|
||||
to_chat(src, "<span class='warning'>Repeat at least every 7 seconds.</span>")
|
||||
target.cpr_time = 1
|
||||
@@ -242,34 +242,7 @@
|
||||
stat("Spacepod Integrity", "[!S.health ? "0" : "[(S.health / initial(S.health)) * 100]"]%")
|
||||
|
||||
/mob/living/carbon/human/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
|
||||
if(!iscarbon(M))
|
||||
LAssailant = null
|
||||
else
|
||||
LAssailant = M
|
||||
if(M.attack_sound)
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
|
||||
add_logs(M, src, "attacked", admin = M.ckey ? TRUE : FALSE) //Only add this to the server logs if they're controlled by a player.
|
||||
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
var/dam_zone = pick(organs_by_name)
|
||||
|
||||
if(M.zone_sel && M.zone_sel.selecting)
|
||||
dam_zone = M.zone_sel.selecting
|
||||
|
||||
if(check_shields(damage)) //Shield check
|
||||
return
|
||||
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone))
|
||||
var/armor = run_armor_check(affecting, "melee") //Armor check
|
||||
|
||||
apply_damage(damage, M.melee_damage_type, affecting, armor)
|
||||
src.visible_message("<span class='danger'>[M] [M.attacktext] [src] in \the [affecting.display_name]!</span>")
|
||||
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/carbon/human/proc/is_loyalty_implanted(mob/living/carbon/human/M)
|
||||
for(var/L in M.contents)
|
||||
@@ -280,74 +253,7 @@
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/attack_slime(mob/living/carbon/slime/M as mob)
|
||||
if(M.Victim)
|
||||
return // can't attack while eating!
|
||||
|
||||
if (health > -100)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>The [M.name] glomps []!</span>", src), 1)
|
||||
add_logs(M, src, "glomped on", 0)
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(M, /mob/living/carbon/slime/adult))
|
||||
damage = rand(10, 35)
|
||||
else
|
||||
damage = rand(5, 25)
|
||||
|
||||
|
||||
var/dam_zone = pick(organs_by_name)
|
||||
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
|
||||
|
||||
if(M.powerlevel > 0)
|
||||
var/stunprob = 10
|
||||
var/power = M.powerlevel + rand(0,3)
|
||||
|
||||
switch(M.powerlevel)
|
||||
if(1 to 2)
|
||||
stunprob = 20
|
||||
if(3 to 4)
|
||||
stunprob = 30
|
||||
if(5 to 6)
|
||||
stunprob = 40
|
||||
if(7 to 8)
|
||||
stunprob = 60
|
||||
if(9)
|
||||
stunprob = 70
|
||||
if(10)
|
||||
stunprob = 95
|
||||
|
||||
if(prob(stunprob))
|
||||
M.powerlevel -= 3
|
||||
if(M.powerlevel < 0)
|
||||
M.powerlevel = 0
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>The [M.name] has shocked []!</span>", src), 1)
|
||||
|
||||
Knockdown(power)
|
||||
if (stuttering < power)
|
||||
stuttering = power
|
||||
Stun(power)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
if (prob(stunprob) && M.powerlevel >= 8)
|
||||
adjustFireLoss(M.powerlevel * rand(6,10))
|
||||
|
||||
|
||||
updatehealth()
|
||||
|
||||
return
|
||||
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/carbon/human/restrained()
|
||||
if (timestopped)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
/mob/living/carbon/human/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
//M.delayNextAttack(10)
|
||||
if(check_shields(0, M.name))
|
||||
visible_message("<span class='danger'>[M] attempted to touch [src]!</span>")
|
||||
@@ -6,58 +6,13 @@
|
||||
|
||||
switch(M.a_intent)
|
||||
if (I_HELP)
|
||||
visible_message(text("<span class='notice'>[M] caresses [src] with its scythe like arm.</span>"))
|
||||
visible_message("<span class='notice'>[M] caresses [src] with its scythe like arm.</span>")
|
||||
|
||||
if (I_GRAB)
|
||||
if(M.grab_check(src))
|
||||
return
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M,src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message(text("<span class='warning'>[] has grabbed [] passively!</span>", M, src))
|
||||
return M.grab_mob(src)
|
||||
|
||||
if(I_HURT)
|
||||
if (w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/damage = rand(15, 30)
|
||||
if(!damage)
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has lunged at [src]!</span>")
|
||||
return 0
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has slashed at [src]!</span>")
|
||||
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
if (damage >= 25)
|
||||
visible_message("<span class='danger'>[M] has wounded [src]!</span>")
|
||||
apply_effect(rand(0.5,3), WEAKEN, armor_block)
|
||||
updatehealth()
|
||||
return M.unarmed_attack_mob(src)
|
||||
|
||||
if(I_DISARM)
|
||||
if (prob(80))
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
Knockdown(rand(3,4))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has tackled down []!</span>", M, src), 1)
|
||||
if (prob(25))
|
||||
M.Knockdown(rand(4,5))
|
||||
else
|
||||
if (prob(80))
|
||||
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
drop_item()
|
||||
visible_message(text("<span class='danger'>[] disarmed []!</span>", M, src))
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
|
||||
visible_message(text("<span class='danger'>[] has tried to disarm []!</span>", M, src))
|
||||
return
|
||||
return M.disarm_mob(src)
|
||||
|
||||
@@ -146,7 +146,7 @@
|
||||
LAssailant = M
|
||||
log_attack("[M.name] ([M.ckey]) kicked by [src.name] ([src.ckey])")
|
||||
|
||||
/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M as mob)
|
||||
/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M)
|
||||
//M.delayNextAttack(10)
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "No attacking people at spawn, you jackass.")
|
||||
@@ -164,57 +164,9 @@
|
||||
return 0
|
||||
|
||||
|
||||
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
|
||||
var/obj/item/clothing/gloves/G = M.gloves
|
||||
if(G.cell)
|
||||
if(M.a_intent == I_HURT)//Stungloves. Any contact will stun the alien.
|
||||
if(G.cell.charge >= 2500)
|
||||
G.cell.use(2500)
|
||||
visible_message("<span class='danger'>[M] touches [src] with the stun gloves!</span>")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Stungloved [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been stungloved by [M.name] ([M.ckey])</font>")
|
||||
if(!iscarbon(M))
|
||||
LAssailant = null
|
||||
else
|
||||
LAssailant = M
|
||||
|
||||
log_attack("<font color='red'>[M.name] ([M.ckey]) stungloved [src.name] ([src.ckey])</font>")
|
||||
|
||||
var/armorblock = run_armor_check(M.zone_sel.selecting, "energy")
|
||||
apply_effects(5,5,0,0,5,0,0,armorblock)
|
||||
return 1
|
||||
else
|
||||
to_chat(M, "<span class='warning'>Not enough charge! </span>")
|
||||
visible_message("<span class='danger'>[src] has been touched with the stun gloves by [M]!</span>")
|
||||
return
|
||||
|
||||
if(istype(M.gloves , /obj/item/clothing/gloves/boxing/hologlove))
|
||||
|
||||
var/damage = rand(0, 9)
|
||||
if(!damage)
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] attempts to punch [src]!</span>")
|
||||
return 0
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
|
||||
if(M_HULK in M.mutations)
|
||||
damage += 5
|
||||
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
|
||||
visible_message("<span class='danger'>[M] punches [src]!</span>")
|
||||
|
||||
apply_damage(damage, HALLOSS, affecting, armor_block)
|
||||
if(damage >= 9)
|
||||
visible_message("<span class='danger'>[M] weakens [src]!</span>")
|
||||
apply_effect(4, WEAKEN, armor_block)
|
||||
|
||||
return
|
||||
else
|
||||
if(istype(M,/mob/living/carbon))
|
||||
// log_debug("No gloves, [M] is truing to infect [src]")
|
||||
M.spread_disease_to(src, "Contact")
|
||||
if(istype(M,/mob/living/carbon))
|
||||
// log_debug("No gloves, [M] is truing to infect [src]")
|
||||
M.spread_disease_to(src, "Contact")
|
||||
|
||||
|
||||
switch(M.a_intent)
|
||||
@@ -222,190 +174,17 @@
|
||||
if(health >= config.health_threshold_crit)
|
||||
help_shake_act(M)
|
||||
return 1
|
||||
// if(M.health < -75) return 0
|
||||
|
||||
if(M.check_body_part_coverage(MOUTH))
|
||||
to_chat(M, "<span class='notice'><B>Remove your [M.get_body_part_coverage(MOUTH)]!</B></span>")
|
||||
return 0
|
||||
if(src.check_body_part_coverage(MOUTH))
|
||||
to_chat(M, "<span class='notice'><B>Remove their [src.get_body_part_coverage(MOUTH)]!</B></span>")
|
||||
return 0
|
||||
|
||||
if (!cpr_time)
|
||||
return 0
|
||||
|
||||
M.visible_message("<span class='danger'>\The [M] is trying perform CPR on \the [src]!</span>")
|
||||
|
||||
cpr_time = 0
|
||||
if(do_after(M, src, 3 SECONDS))
|
||||
adjustOxyLoss(-min(getOxyLoss(), 7))
|
||||
M.visible_message("<span class='danger'>\The [M] performs CPR on \the [src]!</span>")
|
||||
to_chat(src, "<span class='notice'>You feel a breath of fresh air enter your lungs. It feels good.</span>")
|
||||
to_chat(M, "<span class='warning'>Repeat at least every 7 seconds.</span>")
|
||||
cpr_time = 1
|
||||
|
||||
else if(ishuman(M))
|
||||
M.perform_cpr(src)
|
||||
|
||||
if(I_GRAB)
|
||||
if(M.grab_check(src))
|
||||
return 0
|
||||
if(w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M,src)
|
||||
if(locked_to)
|
||||
to_chat(M, "<span class='notice'>You cannot grab [src], \he is buckled in!</span>")
|
||||
if(!G) //the grab will delete itself in New if affecting is anchored
|
||||
return
|
||||
M.put_in_active_hand(G)
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("<span class='warning'>[M] grabs [src] passively!</span>")
|
||||
return 1
|
||||
return M.grab_mob(src)
|
||||
|
||||
if(I_HURT)
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>[M.species.attack_verb != "punches" ? "Slashed" : "Punched"] [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been [M.species.attack_verb == "slashes" ? "slashed" : "punched"] by [M.name] ([M.ckey])</font>")
|
||||
if(!iscarbon(M))
|
||||
LAssailant = null
|
||||
else
|
||||
LAssailant = M
|
||||
|
||||
log_attack("[M.name] ([M.ckey]) [M.species.attack_verb] [src.name] ([src.ckey])")
|
||||
|
||||
|
||||
var/damage = rand(0, M.species.max_hurt_damage)//BS12 EDIT // edited again by Iamgoofball to fix species attacks
|
||||
|
||||
if(!damage)
|
||||
if(M.species.attack_verb == "punches")
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
|
||||
visible_message("<span class='danger'>[M] [M.species.attack_verb] towards [src], but misses!</span>")
|
||||
return 0
|
||||
|
||||
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
|
||||
var/armor_block = run_armor_check(affecting, "melee")
|
||||
|
||||
if(M_HULK in M.mutations)
|
||||
damage += 5
|
||||
|
||||
var/knockout = damage
|
||||
|
||||
if((M_CLAWS in M.mutations) && !istype(M.gloves))
|
||||
damage += 3 //Claws mutation + no gloves (doesn't affect weaken chance)
|
||||
|
||||
if(istype(M.gloves)) //Attacker has gloves
|
||||
var/obj/item/clothing/gloves/G = M.gloves
|
||||
damage += G.damage_added //Increase damage by the gloves' damage modifier
|
||||
knockout += G.bonus_knockout //Increase knockout chance by the gloves' knockout modifier
|
||||
|
||||
if(M.species.attack_verb == "punches")
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
|
||||
visible_message("<span class='danger'>[M] [M.species.attack_verb] [src]!</span>")
|
||||
|
||||
if((knockout >= M.species.max_hurt_damage) && prob(50))
|
||||
visible_message("<span class='danger'>[M] has knocked down [src]!</span>")
|
||||
apply_effect(2, WEAKEN, armor_block)
|
||||
|
||||
if(M.species.punch_damage)
|
||||
damage += M.species.punch_damage
|
||||
|
||||
apply_damage(damage, BRUTE, affecting, armor_block)
|
||||
|
||||
// Horror form can punch people so hard they learn how to fly.
|
||||
if(M.species.punch_throw_range && prob(25))
|
||||
visible_message("<span class='danger'>[src] is thrown by the force of the assault!</span>")
|
||||
var/turf/T = get_turf(src)
|
||||
var/turf/target
|
||||
if(istype(T, /turf/space)) // if ended in space, then range is unlimited
|
||||
target = get_edge_target_turf(T, M.dir)
|
||||
else // otherwise limit to 10 tiles
|
||||
target = get_ranged_target_turf(T, M.dir, M.species.punch_throw_range)
|
||||
src.throw_at(target,100,M.species.punch_throw_speed)
|
||||
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.zone_sel && H.zone_sel.selecting == "mouth")
|
||||
var/chance = 0.5 * damage
|
||||
if(M_HULK in H.mutations)
|
||||
chance += 50
|
||||
if(prob(chance))
|
||||
knock_out_teeth(H)
|
||||
|
||||
return M.unarmed_attack_mob(src)
|
||||
|
||||
if(I_DISARM)
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Disarmed [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been disarmed by [M.name] ([M.ckey])</font>")
|
||||
|
||||
log_attack("[M.name] ([M.ckey]) disarmed [src.name] ([src.ckey])")
|
||||
|
||||
if(w_uniform)
|
||||
w_uniform.add_fingerprint(M)
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
|
||||
|
||||
for(var/obj/item/weapon/gun/G in held_items)
|
||||
var/index = is_holding_item(G)
|
||||
var/chance = (index == active_hand ? 40 : 20)
|
||||
|
||||
if (prob(chance))
|
||||
visible_message("<spawn class=danger>[G], held by [src], goes off during struggle!")
|
||||
var/list/turfs = list()
|
||||
for(var/turf/T in view())
|
||||
turfs += T
|
||||
var/turf/target = pick(turfs)
|
||||
return G.afterattack(target,src, "struggle" = 1)
|
||||
|
||||
var/randn = rand(1, 100)
|
||||
if (randn <= 25)
|
||||
apply_effect(4, WEAKEN, run_armor_check(affecting, "melee"))
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("<span class='danger'>[M] has pushed [src]!</span>")
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='red'>Pushed [src.name] ([src.ckey])</font>")
|
||||
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been pushed by [M.name] ([M.ckey])</font>")
|
||||
if(!iscarbon(M))
|
||||
LAssailant = null
|
||||
else
|
||||
LAssailant = M
|
||||
|
||||
log_attack("[M.name] ([M.ckey]) pushed [src.name] ([src.ckey])")
|
||||
return
|
||||
|
||||
var/talked = 0 // BubbleWrap
|
||||
|
||||
if(randn <= 60)
|
||||
//BubbleWrap: Disarming breaks a pull
|
||||
if(pulling)
|
||||
visible_message("<span class='danger'>[M] has broken [src]'s grip on [pulling]!</span>")
|
||||
talked = 1
|
||||
stop_pulling()
|
||||
|
||||
//BubbleWrap: Disarming also breaks a grab - this will also stop someone being choked, won't it?
|
||||
for(var/obj/item/weapon/grab/G in held_items)
|
||||
if(G.affecting)
|
||||
visible_message("<span class='danger'>[M] has broken [src]'s grip on [G.affecting]!</span>")
|
||||
talked = 1
|
||||
spawn(1)
|
||||
qdel(G)
|
||||
G = null
|
||||
//End BubbleWrap
|
||||
|
||||
if(!talked) //BubbleWrap
|
||||
drop_item()
|
||||
visible_message("<span class='danger'>[M] has disarmed [src]!</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
return
|
||||
|
||||
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
visible_message("<span class='danger'>[M] attempted to disarm [src]!</span>")
|
||||
return M.disarm_mob(src)
|
||||
return
|
||||
|
||||
/mob/living/carbon/human/proc/afterattack(atom/target as mob|obj|turf|area, mob/living/user as mob|obj, inrange, params)
|
||||
|
||||
@@ -1,27 +1,8 @@
|
||||
/mob/living/carbon/human/attack_paw(mob/M as mob)
|
||||
/mob/living/carbon/human/attack_paw(mob/living/M)
|
||||
..()
|
||||
//M.delayNextAttack(10)
|
||||
if (M.a_intent == I_HELP)
|
||||
help_shake_act(M)
|
||||
else
|
||||
if (istype(wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
return
|
||||
|
||||
if(istype(M, /mob/living/carbon/monkey))
|
||||
var/mob/living/carbon/monkey/Mo = M
|
||||
src.visible_message("<span class='danger'>[Mo.name] [Mo.attack_text] [name]!</span>")
|
||||
switch(M.a_intent)
|
||||
if(I_HELP)
|
||||
help_shake_act(M)
|
||||
else
|
||||
src.visible_message("<span class='danger'>[M.name] bites [name]!</span>")
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
var/dam_zone = pick(organs_by_name)
|
||||
var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone))
|
||||
apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, "melee"))
|
||||
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
if(istype(D, /datum/disease/jungle_fever))
|
||||
var/mob/living/carbon/human/H = src
|
||||
src = null
|
||||
src = H.monkeyize()
|
||||
contract_disease(D,1,0)
|
||||
return
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
@@ -288,7 +288,7 @@ This function restores all organs.
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/get_organ(var/zone)
|
||||
/mob/living/carbon/human/get_organ(var/zone)
|
||||
if(!zone)
|
||||
zone = LIMB_CHEST
|
||||
if (zone in list( "eyes", "mouth" ))
|
||||
@@ -299,8 +299,7 @@ This function restores all organs.
|
||||
|
||||
//visible_message("Hit debug. [damage] | [damagetype] | [def_zone] | [blocked] | [sharp] | [used_weapon]")
|
||||
if((damagetype != BRUTE) && (damagetype != BURN))
|
||||
..(damage, damagetype, def_zone, blocked, ignore_events = ignore_events)
|
||||
return 1
|
||||
return ..(damage, damagetype, def_zone, blocked, ignore_events = ignore_events)
|
||||
|
||||
if(blocked >= 2)
|
||||
return 0
|
||||
@@ -341,7 +340,7 @@ This function restores all organs.
|
||||
|
||||
//Embedded projectile code.
|
||||
if(!organ)
|
||||
return
|
||||
return damage
|
||||
/*/vg/ EDIT
|
||||
if(istype(used_weapon,/obj/item/weapon))
|
||||
var/obj/item/weapon/W = used_weapon //Sharp objects will always embed if they do enough damage.
|
||||
@@ -383,7 +382,7 @@ This function restores all organs.
|
||||
adjust_fire_stacks(0.5) //as seen in ignite code
|
||||
update_icon = 1
|
||||
qdel(F)
|
||||
return 1
|
||||
return damage
|
||||
|
||||
//Adds cancer, including stage of cancer and limb
|
||||
//Right now cancer is adminbus only. You can inflict it via the full (old) Player Panel and all "prayer types" (includes Centcomm message)
|
||||
|
||||
2
code/modules/mob/living/carbon/martian/combat.dm
Normal file
2
code/modules/mob/living/carbon/martian/combat.dm
Normal file
@@ -0,0 +1,2 @@
|
||||
/mob/living/carbon/martian/get_unarmed_damage_zone(mob/living/victim)
|
||||
return zone_sel.selecting
|
||||
29
code/modules/mob/living/carbon/monkey/combat.dm
Normal file
29
code/modules/mob/living/carbon/monkey/combat.dm
Normal file
@@ -0,0 +1,29 @@
|
||||
/mob/living/carbon/monkey/get_unarmed_verb()
|
||||
return attack_text
|
||||
|
||||
/mob/living/carbon/monkey/get_unarmed_damage()
|
||||
return rand(1,3)
|
||||
|
||||
/mob/living/carbon/monkey/get_unarmed_hit_sound()
|
||||
return 'sound/weapons/bite.ogg'
|
||||
|
||||
/mob/living/carbon/monkey/unarmed_attack_mob(mob/living/)
|
||||
if(istype(wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
to_chat(src, "<span class='notice'>You can't do this with \the [wear_mask] on!</span>")
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/living/carbon/monkey/after_unarmed_attack(mob/living/target, damage, damage_type, organ, armor)
|
||||
if(iscarbon(target))
|
||||
for(var/datum/disease/D in viruses)
|
||||
|
||||
if(istype(D, /datum/disease/jungle_fever) && ishuman(target)) //Jungle fever - special case
|
||||
var/mob/living/carbon/human/H = target
|
||||
var/mob/living/carbon/monkey/M = H.monkeyize()
|
||||
M.contract_disease(D, 1, 0)
|
||||
|
||||
else if(D.spread == "Bite")
|
||||
target.contract_disease(D, 1, 0)
|
||||
|
||||
return ..()
|
||||
@@ -10,7 +10,7 @@
|
||||
meat_type = /obj/item/weapon/reagent_containers/food/snacks/meat/animal/monkey
|
||||
species_type = /mob/living/carbon/monkey
|
||||
treadmill_speed = 0.8 //Slow apes!
|
||||
var/attack_text = "bites"
|
||||
var/attack_text = "bit"
|
||||
var/languagetoadd = LANGUAGE_MONKEY
|
||||
var/namenumbers = TRUE
|
||||
|
||||
@@ -237,30 +237,18 @@
|
||||
armorscore = uniform.armor[type]
|
||||
return armorscore
|
||||
|
||||
/mob/living/carbon/monkey/attack_paw(mob/M as mob)
|
||||
/mob/living/carbon/monkey/attack_paw(mob/living/M)
|
||||
..()
|
||||
|
||||
if (M.a_intent == I_HELP)
|
||||
help_shake_act(M)
|
||||
else
|
||||
if ((M.a_intent == I_HURT && !( istype(wear_mask, /obj/item/clothing/mask/muzzle) )))
|
||||
if ((prob(75) && health > 0))
|
||||
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
|
||||
if(istype(M, /mob/living/carbon/monkey))
|
||||
var/mob/living/carbon/monkey/Mo = M
|
||||
src.visible_message("<span class='danger'>[Mo.name] [Mo.attack_text] [name]!</span>")
|
||||
else
|
||||
src.visible_message("<span class='danger'>[M.name] bites [name]!</span>")
|
||||
var/damage = rand(1, 5)
|
||||
adjustBruteLoss(damage)
|
||||
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
|
||||
for(var/datum/disease/D in M.viruses)
|
||||
if(D.spread == "Bite")
|
||||
contract_disease(D,1,0)
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<span class='danger'>[M.name] lunges towards [name], but misses!</span>", 1)
|
||||
return
|
||||
switch(M.a_intent)
|
||||
if(I_HELP)
|
||||
help_shake_act(M)
|
||||
if(I_HURT)
|
||||
M.unarmed_attack_mob(src)
|
||||
if(I_DISARM)
|
||||
M.disarm_mob(src)
|
||||
if(I_GRAB)
|
||||
M.grab_mob(src)
|
||||
|
||||
|
||||
/mob/living/carbon/monkey/proc/defense(var/power, var/def_zone)
|
||||
@@ -276,237 +264,37 @@
|
||||
return damage
|
||||
|
||||
/mob/living/carbon/monkey/attack_hand(mob/living/carbon/human/M as mob)
|
||||
if (!ticker)
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "No attacking people at spawn, you jackass.")
|
||||
return
|
||||
switch(M.a_intent)
|
||||
if(I_HELP)
|
||||
help_shake_act(M)
|
||||
|
||||
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
|
||||
var/obj/item/clothing/gloves/G = M.gloves
|
||||
if(G.cell)
|
||||
if(M.a_intent == I_HURT)//Stungloves. Any contact will stun the alien.
|
||||
if(G.cell.charge >= 2500)
|
||||
G.cell.use(2500)
|
||||
Knockdown(5)
|
||||
if (stuttering < 5)
|
||||
stuttering = 5
|
||||
Stun(5)
|
||||
if(I_HURT)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if (O.client)
|
||||
O.show_message("<span class='danger'>[src] has been touched with the stun gloves by [M]!</span>", 1, "<span class='warning'>You hear someone fall</span>", 2)
|
||||
return
|
||||
else
|
||||
to_chat(M, "<span class='warning'>Not enough charge! </span>")
|
||||
return
|
||||
if(I_GRAB)
|
||||
M.grab_mob(src)
|
||||
|
||||
if (M.a_intent == I_HELP)
|
||||
help_shake_act(M)
|
||||
else
|
||||
if (M.a_intent == I_HURT)
|
||||
if ((prob(75) && health > 0))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has punched [name]!</span>", M), 1)
|
||||
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
var/damage = rand(5, 10)
|
||||
var/dam_zone = ""
|
||||
if(M.zone_sel && M.zone_sel.selecting)
|
||||
dam_zone = M.zone_sel.selecting
|
||||
damage = defense(damage,dam_zone)
|
||||
if ((damage > 5) && prob(40))
|
||||
damage = rand(10, 15)
|
||||
if (paralysis < 5)
|
||||
Paralyse(rand(10, 15))
|
||||
spawn( 0 )
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has knocked out [name]!</span>", M), 1)
|
||||
return
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has attempted to punch [name]!</span>", M), 1)
|
||||
else
|
||||
if (M.a_intent == I_GRAB)
|
||||
if (M.grab_check(src))
|
||||
return
|
||||
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M,src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("<span class='warning'>[] has grabbed [name] passively!</span>", M), 1)
|
||||
else
|
||||
if (!( paralysis ))
|
||||
if (prob(25))
|
||||
Paralyse(2)
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has pushed down [name]!</span>", M), 1)
|
||||
else
|
||||
drop_item()
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has disarmed [name]!</span>", M), 1)
|
||||
if(I_DISARM)
|
||||
M.disarm_mob(src)
|
||||
return
|
||||
|
||||
/mob/living/carbon/monkey/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if (!ticker)
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "No attacking people at spawn, you jackass.")
|
||||
return
|
||||
|
||||
switch(M.a_intent)
|
||||
if (I_HELP)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='notice'>[M] caresses [src] with its scythe like arm.</span>"), 1)
|
||||
visible_message("<span class='notice'>[M] caresses [src] with its scythe like arm.</span>")
|
||||
|
||||
if (I_HURT)
|
||||
if ((prob(95) && health > 0))
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
var/damage = rand(15, 30)
|
||||
if (damage >= 25)
|
||||
damage = rand(20, 40)
|
||||
if (paralysis < 15)
|
||||
Paralyse(rand(10, 15))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has wounded [name]!</span>", M), 1)
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has slashed [name]!</span>", M), 1)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has attempted to lunge at [name]!</span>", M), 1)
|
||||
return M.unarmed_attack_mob(src)
|
||||
|
||||
if (I_GRAB)
|
||||
if (M.grab_check(src))
|
||||
return
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M,src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("<span class='warning'>[] has grabbed [name] passively!</span>", M), 1)
|
||||
return M.grab_mob(src)
|
||||
|
||||
if (I_DISARM)
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
var/damage = 5
|
||||
if(prob(95))
|
||||
Knockdown(15)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has tackled down [name]!</span>", M), 1)
|
||||
else
|
||||
drop_item()
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has disarmed [name]!</span>", M), 1)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
return
|
||||
return M.disarm_mob(src)
|
||||
|
||||
//using the default attack_animal() in carbon.dm
|
||||
|
||||
/mob/living/carbon/monkey/attack_slime(mob/living/carbon/slime/M as mob)
|
||||
if (!ticker)
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
|
||||
if(M.Victim)
|
||||
return // can't attack while eating!
|
||||
|
||||
if (health > -100)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>The [M.name] glomps []!</span>", src), 1)
|
||||
add_logs(M, src, "glomped on", 0)
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
damage = rand(20, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
|
||||
adjustBruteLoss(damage)
|
||||
|
||||
if(M.powerlevel > 0)
|
||||
var/stunprob = 10
|
||||
var/power = M.powerlevel + rand(0,3)
|
||||
|
||||
switch(M.powerlevel)
|
||||
if(1 to 2)
|
||||
stunprob = 20
|
||||
if(3 to 4)
|
||||
stunprob = 30
|
||||
if(5 to 6)
|
||||
stunprob = 40
|
||||
if(7 to 8)
|
||||
stunprob = 60
|
||||
if(9)
|
||||
stunprob = 70
|
||||
if(10)
|
||||
stunprob = 95
|
||||
|
||||
if(prob(stunprob))
|
||||
M.powerlevel -= 3
|
||||
if(M.powerlevel < 0)
|
||||
M.powerlevel = 0
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>The [M.name] has shocked []!</span>", src), 1)
|
||||
|
||||
Knockdown(power)
|
||||
if (stuttering < power)
|
||||
stuttering = power
|
||||
Stun(power)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
if (prob(stunprob) && M.powerlevel >= 8)
|
||||
adjustFireLoss(M.powerlevel * rand(6,10))
|
||||
|
||||
|
||||
updatehealth()
|
||||
|
||||
return
|
||||
/mob/living/carbon/monkey/attack_slime(mob/living/carbon/slime/M)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/carbon/monkey/Stat()
|
||||
..()
|
||||
|
||||
84
code/modules/mob/living/carbon/slime/combat.dm
Normal file
84
code/modules/mob/living/carbon/slime/combat.dm
Normal file
@@ -0,0 +1,84 @@
|
||||
/mob/living/carbon/slime/unarmed_attacked(mob/living/attacker, damage, damage_type, zone)
|
||||
.=..()
|
||||
|
||||
if(health > 10)
|
||||
attacked += 10
|
||||
|
||||
/mob/living/carbon/slime/get_unarmed_verb()
|
||||
return "glomped on"
|
||||
|
||||
/mob/living/carbon/slime/get_unarmed_damage(mob/living/target)
|
||||
if(isslime(target))
|
||||
return rand(1,3)
|
||||
|
||||
return rand(5, 35)
|
||||
|
||||
/mob/living/carbon/slime/adult/get_unarmed_damage(mob/living/target)
|
||||
if(isslime(target))
|
||||
return rand(1,6)
|
||||
|
||||
return rand(15, 40)
|
||||
|
||||
/mob/living/carbon/slime/get_unarmed_hit_sound()
|
||||
return 'sound/weapons/welderattack.ogg'
|
||||
|
||||
/mob/living/carbon/slime/proc/get_stun_chance()
|
||||
switch(powerlevel)
|
||||
if(1 to 2)
|
||||
return 20
|
||||
if(3 to 4)
|
||||
return 30
|
||||
if(5 to 6)
|
||||
return 40
|
||||
if(7 to 8)
|
||||
return 60
|
||||
if(9)
|
||||
return 70
|
||||
if(10)
|
||||
return 95
|
||||
else
|
||||
return 10
|
||||
|
||||
/mob/living/carbon/slime/unarmed_attack_mob(mob/living/target)
|
||||
if(target.health < -100)
|
||||
to_chat(src, "<span class='notice'>\The [target] is already dead.</span>")
|
||||
return
|
||||
|
||||
if(Victim)
|
||||
to_chat(src, "<span class='notice'>You can't attack while eating.</span>")
|
||||
return
|
||||
|
||||
.=..()
|
||||
|
||||
|
||||
if(powerlevel > 0)
|
||||
if(isalien(target) || ishuman(target) || ismonkey(target))
|
||||
var/stunprob = get_stun_chance()
|
||||
var/power = powerlevel + rand(0,3)
|
||||
|
||||
if(prob(stunprob))
|
||||
powerlevel = max(powerlevel-3, 0)
|
||||
|
||||
stun_mob(target, power)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, target)
|
||||
s.start()
|
||||
|
||||
if (prob(stunprob) && powerlevel >= 8)
|
||||
target.adjustFireLoss(powerlevel * rand(6,10))
|
||||
|
||||
/mob/living/carbon/slime/proc/stun_mob(mob/living/target, power)
|
||||
if(isliving(target))
|
||||
target.Knockdown(power)
|
||||
target.Stun(power)
|
||||
if (target.stuttering < power)
|
||||
target.stuttering = power
|
||||
|
||||
visible_message("<span class='danger'>\The [src] has shocked \the [target]!</span>")
|
||||
else if(issilicon(target))
|
||||
target.flash_eyes(visual = 1, type = /obj/screen/fullscreen/flash/noise)
|
||||
if(powerlevel >= 8)
|
||||
adjustBruteLoss(powerlevel * rand(6,10))
|
||||
|
||||
visible_message("<span class='danger'>\The [src] has electrified \the [target]!</span>")
|
||||
@@ -197,12 +197,7 @@
|
||||
..()
|
||||
|
||||
if(statpanel("Status"))
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
stat(null, "Health: [round((health / 200) * 100)]%")
|
||||
else
|
||||
stat(null, "Health: [round((health / 150) * 100)]%")
|
||||
|
||||
|
||||
stat(null, "Health: [round((health / maxHealth) * 100)]%")
|
||||
|
||||
if(istype(src,/mob/living/carbon/slime/adult))
|
||||
stat(null, "Nutrition: [nutrition]/1200")
|
||||
@@ -307,106 +302,38 @@
|
||||
/mob/living/carbon/slime/attack_ui(slot)
|
||||
return
|
||||
|
||||
/mob/living/carbon/slime/attack_slime(mob/living/carbon/slime/M as mob)
|
||||
if (!ticker)
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
|
||||
if(Victim)
|
||||
return // can't attack while eating!
|
||||
|
||||
if (health > -100)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>The [M.name] has glomped []!</span>", src), 1)
|
||||
add_logs(M, src, "glomped on", 0)
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
attacked += 5
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
damage = rand(1, 6)
|
||||
else
|
||||
damage = rand(1, 3)
|
||||
|
||||
adjustBruteLoss(damage)
|
||||
/mob/living/carbon/slime/attack_slime(mob/living/carbon/slime/M)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
|
||||
updatehealth()
|
||||
/mob/living/carbon/slime/attack_animal(mob/living/simple_animal/M)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
return
|
||||
|
||||
|
||||
/mob/living/carbon/slime/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
if(M.attack_sound)
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<span class='warning'><B>[M]</B> [M.attacktext] [src]!</span>", 1)
|
||||
|
||||
add_logs(M, src, "attacked", admin = M.ckey ? TRUE : FALSE) //Only add this to the server logs if they're controlled by a player.
|
||||
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
/mob/living/carbon/slime/attack_paw(mob/living/carbon/monkey/M as mob)
|
||||
/mob/living/carbon/slime/attack_paw(mob/living/carbon/monkey/M)
|
||||
if(!(istype(M, /mob/living/carbon/monkey)))
|
||||
return//Fix for aliens receiving double messages when attacking other aliens.
|
||||
|
||||
if (!ticker)
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "No attacking people at spawn, you jackass.")
|
||||
return
|
||||
..()
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if (I_HELP)
|
||||
if(I_HELP)
|
||||
help_shake_act(M)
|
||||
else
|
||||
if (istype(wear_mask, /obj/item/clothing/mask/muzzle))
|
||||
return
|
||||
if (health > 0)
|
||||
attacked += 10
|
||||
//playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[M.name] has attacked [src]!</span>"), 1)
|
||||
adjustBruteLoss(rand(1, 3))
|
||||
updatehealth()
|
||||
return
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
|
||||
/mob/living/carbon/slime/attack_hand(mob/living/carbon/human/M as mob)
|
||||
if (!ticker)
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "No attacking people at spawn, you jackass.")
|
||||
return
|
||||
|
||||
..()
|
||||
|
||||
if(Victim)
|
||||
if(Victim == M)
|
||||
if(prob(60))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("<span class='warning'>[M] attempts to wrestle \the [name] off!</span>", 1)
|
||||
visible_message("<span class='warning'>[M] attempts to wrestle \the [name] off!</span>")
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("<span class='warning'>[M] manages to wrestle \the [name] off!</span>", 1)
|
||||
visible_message("<span class='warning'>[M] manages to wrestle \the [name] off!</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
if(prob(90) && !client)
|
||||
@@ -426,15 +353,11 @@
|
||||
|
||||
else
|
||||
if(prob(30))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("<span class='warning'>[M] attempts to wrestle \the [name] off of [Victim]!</span>", 1)
|
||||
visible_message("<span class='warning'>[M] attempts to wrestle \the [name] off of [Victim]!</span>")
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("<span class='warning'>[M] manages to wrestle \the [name] off of [Victim]!</span>", 1)
|
||||
visible_message("<span class='warning'>[M] manages to wrestle \the [name] off of [Victim]!</span>")
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
|
||||
if(prob(80) && !client)
|
||||
@@ -457,43 +380,13 @@
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
if(M.gloves && istype(M.gloves,/obj/item/clothing/gloves))
|
||||
var/obj/item/clothing/gloves/G = M.gloves
|
||||
if(G.cell)
|
||||
if(M.a_intent == I_HURT)//Stungloves. Any contact will stun the alien.
|
||||
if(G.cell.charge >= 2500)
|
||||
G.cell.use(2500)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("<span class='danger'>[src] has been touched with the stun gloves by [M]!</span>", 1, "<span class='warning'>You hear someone fall.</span>", 2)
|
||||
return
|
||||
else
|
||||
to_chat(M, "<span class='warning'>Not enough charge! </span>")
|
||||
return
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if (I_HELP)
|
||||
help_shake_act(M)
|
||||
|
||||
if (I_GRAB)
|
||||
if (M.grab_check(src))
|
||||
return
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M,src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='warning'>[] has grabbed [] passively!</span>", M, src), 1)
|
||||
M.grab_mob(src)
|
||||
|
||||
else
|
||||
|
||||
@@ -516,110 +409,49 @@
|
||||
|
||||
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has punched []!</span>", M, src), 1)
|
||||
visible_message("<span class='danger'>[M] has punched [src]!</span>")
|
||||
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has attempted to punch []!</span>", M, src), 1)
|
||||
visible_message("<span class='danger'>[M] has attempted to punch [src]!</span>")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/carbon/slime/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if (!ticker)
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "No attacking people at spawn, you jackass.")
|
||||
return
|
||||
|
||||
switch(M.a_intent)
|
||||
if (I_HELP)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='notice'>[M] caresses [src] with its scythe like arm.</span>"), 1)
|
||||
visible_message("<span class='notice'>[M] caresses [src] with its scythe like arm.</span>")
|
||||
|
||||
if (I_HURT)
|
||||
|
||||
if ((prob(95) && health > 0))
|
||||
attacked += 10
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
|
||||
var/damage = rand(15, 30)
|
||||
if (damage >= 25)
|
||||
damage = rand(20, 40)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has attacked [name]!</span>", M), 1)
|
||||
else
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has wounded [name]!</span>", M), 1)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has attempted to lunge at [name]!</span>", M), 1)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
if (I_GRAB)
|
||||
if (M.grab_check(src))
|
||||
return
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M,src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("<span class='warning'>[] has grabbed [name] passively!</span>", M), 1)
|
||||
M.grab_mob(src)
|
||||
|
||||
if (I_DISARM)
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
|
||||
var/damage = 5
|
||||
attacked += 10
|
||||
|
||||
if(prob(95))
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has tackled [name]!</span>", M), 1)
|
||||
visible_message("<span class='danger'>[M] has tackled [src]!</span>")
|
||||
|
||||
if(Victim)
|
||||
Victim = null
|
||||
anchored = 0
|
||||
if(prob(80) && !client)
|
||||
Discipline++
|
||||
if(!istype(src, /mob/living/carbon/slime))
|
||||
if(Discipline == 1)
|
||||
attacked = 0
|
||||
if(Victim)
|
||||
Victim = null
|
||||
anchored = 0
|
||||
if(prob(80) && !client)
|
||||
Discipline++
|
||||
|
||||
spawn()
|
||||
SStun = 1
|
||||
sleep(rand(5,20))
|
||||
SStun = 0
|
||||
SStun = 1
|
||||
spawn(rand(5,20))
|
||||
SStun = 0
|
||||
|
||||
spawn(0)
|
||||
step_away(src,M,15)
|
||||
spawn(3)
|
||||
step_away(src,M,15)
|
||||
|
||||
step_away(src,M,15)
|
||||
sleep(3)
|
||||
step_away(src,M,15)
|
||||
|
||||
else
|
||||
drop_item()
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has disarmed [name]!</span>", M), 1)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
@@ -42,7 +42,7 @@ var/global/list/whitelisted_species = list("Human")
|
||||
var/tail // Name of tail image in species effects icon file.
|
||||
var/list/known_languages = list(LANGUAGE_GALACTIC_COMMON) // Languages that this species innately knows.
|
||||
var/default_language = LANGUAGE_GALACTIC_COMMON // Default language is used when 'say' is used without modifiers.
|
||||
var/attack_verb = "punches" // Empty hand hurt intent verb.
|
||||
var/attack_verb = "punched" // Empty hand hurt intent verb.
|
||||
var/punch_damage = 0 // Extra empty hand attack damage.
|
||||
var/punch_throw_range = 0
|
||||
var/punch_throw_speed = 1
|
||||
@@ -84,7 +84,7 @@ var/global/list/whitelisted_species = list("Human")
|
||||
var/footprint_type = /obj/effect/decal/cleanable/blood/tracks/footprints //The type of footprint the species leaves if they are not wearing shoes. If we ever get any other than human and vox, maybe this should be explicitly defined for each species.
|
||||
|
||||
// For grays
|
||||
var/max_hurt_damage = 5 // Max melee damage dealt + 5 if hulk
|
||||
var/max_hurt_damage = 5 // Max melee damage dealt
|
||||
var/list/default_mutations = list()
|
||||
var/list/default_blocks = list() // Don't touch.
|
||||
var/list/default_block_names = list() // Use this instead, using the names from setupgame.dm
|
||||
@@ -293,7 +293,7 @@ var/global/list/whitelisted_species = list("Human")
|
||||
deform = 'icons/mob/human_races/r_def_lizard.dmi'
|
||||
known_languages = list(LANGUAGE_UNATHI)
|
||||
tail = "sogtail"
|
||||
attack_verb = "scratches"
|
||||
attack_verb = "scratched"
|
||||
punch_damage = 5
|
||||
primitive = /mob/living/carbon/monkey/unathi
|
||||
darksight = 3
|
||||
@@ -319,7 +319,6 @@ var/global/list/whitelisted_species = list("Human")
|
||||
icobase = 'icons/mob/human_races/r_skeleton.dmi'
|
||||
deform = 'icons/mob/human_races/r_skeleton.dmi' // TODO: Need deform.
|
||||
known_languages = list(LANGUAGE_CLATTER)
|
||||
attack_verb = "punches"
|
||||
has_sweat_glands = 0
|
||||
flags = IS_WHITELISTED | HAS_LIPS | NO_BREATHE | NO_BLOOD | NO_SKIN
|
||||
|
||||
@@ -401,7 +400,7 @@ var/global/list/whitelisted_species = list("Human")
|
||||
deform = 'icons/mob/human_races/r_def_tajaran.dmi'
|
||||
known_languages = list(LANGUAGE_CATBEAST, LANGUAGE_MOUSE)
|
||||
tail = "tajtail"
|
||||
attack_verb = "scratches"
|
||||
attack_verb = "scratched"
|
||||
punch_damage = 2 //Claws add 3 damage without gloves, so the total is 5
|
||||
darksight = 8
|
||||
|
||||
@@ -476,7 +475,6 @@ var/global/list/whitelisted_species = list("Human")
|
||||
icobase = 'icons/mob/human_races/r_grey.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_grey.dmi'
|
||||
known_languages = list(LANGUAGE_GREY)
|
||||
attack_verb = "punches"
|
||||
darksight = 5 // BOOSTED from 2
|
||||
eyes = "grey_eyes_s"
|
||||
|
||||
@@ -520,7 +518,6 @@ var/global/list/whitelisted_species = list("Human")
|
||||
icobase = 'icons/mob/human_races/r_muton.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_muton.dmi'
|
||||
//known_languages = list("Muton") //this language doesn't even EXIST
|
||||
attack_verb = "punches"
|
||||
darksight = 1
|
||||
eyes = "eyes_s"
|
||||
|
||||
@@ -763,7 +760,7 @@ var/global/list/whitelisted_species = list("Human")
|
||||
icobase = 'icons/mob/human_races/r_plant.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_plant.dmi'
|
||||
known_languages = list(LANGUAGE_ROOTSPEAK)
|
||||
attack_verb = "slashes"
|
||||
attack_verb = "slashed"
|
||||
punch_damage = 5
|
||||
primitive = /mob/living/carbon/monkey/diona
|
||||
|
||||
@@ -793,7 +790,6 @@ var/global/list/whitelisted_species = list("Human")
|
||||
icobase = 'icons/mob/human_races/r_golem.dmi'
|
||||
deform = 'icons/mob/human_races/r_def_golem.dmi'
|
||||
known_languages = list(LANGUAGE_GOLEM)
|
||||
attack_verb = "punches"
|
||||
has_sweat_glands = 0
|
||||
flags = HAS_LIPS | NO_BREATHE | NO_BLOOD | NO_SKIN | NO_PAIN | IS_BULKY
|
||||
uniform_icons = 'icons/mob/uniform_fat.dmi'
|
||||
@@ -903,7 +899,7 @@ var/global/list/whitelisted_species = list("Human")
|
||||
icobase = 'icons/mob/human_races/r_grue.dmi' // Normal icon set.
|
||||
deform = 'icons/mob/human_races/r_def_grue.dmi' // Mutated icon set.
|
||||
eyes = "grue_eyes_s"
|
||||
attack_verb = "claws"
|
||||
attack_verb = "clawed"
|
||||
flags = HAS_LIPS | NO_PAIN | IS_WHITELISTED
|
||||
punch_damage = 7
|
||||
darksight = 8
|
||||
|
||||
104
code/modules/mob/living/combat.dm
Normal file
104
code/modules/mob/living/combat.dm
Normal file
@@ -0,0 +1,104 @@
|
||||
/mob/living/proc/grab_mob(mob/living/target)
|
||||
if(grab_check(target))
|
||||
return
|
||||
if(target.locked_to)
|
||||
to_chat(src, "<span class='notice'>You cannot grab \the [target], \he is buckled in!</span>")
|
||||
return
|
||||
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab, src, target)
|
||||
if(!G) //the grab will delete itself in New if affecting is anchored
|
||||
return
|
||||
|
||||
put_in_active_hand(G)
|
||||
target.grabbed_by += G
|
||||
|
||||
G.synch()
|
||||
target.LAssailant = src
|
||||
target.grabbed_by(src)
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
visible_message("<span class='warning'>[src] grabs [target] passively!</span>")
|
||||
return 1
|
||||
|
||||
/mob/living/proc/grabbed_by(mob/living/grabber)
|
||||
return
|
||||
|
||||
/mob/living/proc/disarm_mob(mob/living/target)
|
||||
return
|
||||
|
||||
/mob/living/proc/disarmed_by(mob/living/disarmer)
|
||||
return
|
||||
|
||||
/mob/living/proc/break_grabs(mob/living/target)
|
||||
for(var/obj/item/weapon/grab/G in target.held_items)
|
||||
if(G.affecting)
|
||||
visible_message("<span class='danger'>[src] has broken [target]'s grip on [G.affecting]!</span>")
|
||||
spawn(1)
|
||||
qdel(G)
|
||||
G = null
|
||||
|
||||
. = TRUE
|
||||
|
||||
/mob/living/proc/break_pulls(mob/living/target)
|
||||
if(target.pulling)
|
||||
visible_message("<span class='danger'>[src] has broken [target]'s grip on [target.pulling]!</span>")
|
||||
target.stop_pulling()
|
||||
return TRUE
|
||||
|
||||
/mob/living/proc/get_unarmed_damage(mob/living/victim)
|
||||
return rand(0,10)
|
||||
|
||||
/mob/living/proc/get_unarmed_verb(mob/living/victim)
|
||||
return "hit"
|
||||
|
||||
/mob/living/proc/get_unarmed_hit_sound(mob/living/victim)
|
||||
return "punch"
|
||||
|
||||
/mob/living/proc/get_unarmed_miss_sound(mob/living/victim)
|
||||
return 'sound/weapons/punchmiss.ogg'
|
||||
|
||||
/mob/living/proc/get_unarmed_damage_type(mob/living/victim)
|
||||
return BRUTE
|
||||
|
||||
/mob/living/proc/get_unarmed_damage_zone(mob/living/victim)
|
||||
if(zone_sel)
|
||||
return zone_sel.selecting
|
||||
|
||||
return pick(LIMB_CHEST, LIMB_LEFT_HAND, LIMB_RIGHT_HAND, LIMB_LEFT_ARM, LIMB_RIGHT_ARM, LIMB_LEFT_LEG, LIMB_RIGHT_LEG, LIMB_LEFT_FOOT, LIMB_RIGHT_FOOT, LIMB_HEAD)
|
||||
|
||||
/mob/living/proc/unarmed_attack_mob(mob/living/target)
|
||||
var/damage = get_unarmed_damage(target)
|
||||
|
||||
if(!damage)
|
||||
var/miss_sound = get_unarmed_miss_sound(target)
|
||||
|
||||
if(miss_sound)
|
||||
playsound(loc, miss_sound, 25, 1, -1)
|
||||
|
||||
visible_message("<span class='danger'>[src] has missed [target]!</span>")
|
||||
return
|
||||
|
||||
var/zone = ran_zone(get_unarmed_damage_zone(target))
|
||||
var/datum/organ/external/affecting = target.get_organ(zone)
|
||||
var/armor_block = target.run_armor_check(affecting, "melee")
|
||||
var/damage_type = get_unarmed_damage_type(target)
|
||||
var/attack_verb = get_unarmed_verb(target)
|
||||
var/attack_sound = get_unarmed_hit_sound(target)
|
||||
|
||||
if(attack_sound)
|
||||
playsound(loc, attack_sound, 25, 1, -1)
|
||||
visible_message("<span class='danger'>[src] has [attack_verb] [target]!</span>")
|
||||
|
||||
var/damage_done = target.apply_damage(damage, damage_type, affecting, armor_block)
|
||||
target.unarmed_attacked(src, damage, damage_type, zone)
|
||||
after_unarmed_attack(target, damage, damage_type, affecting, armor_block)
|
||||
|
||||
add_logs(src, target, "attacked ([damage_done]dmg)", admin = (src.ckey && target.ckey) ? TRUE : FALSE) //Only add this to the server logs if both mobs were controlled by player
|
||||
|
||||
return damage_done
|
||||
|
||||
/mob/living/proc/after_unarmed_attack(mob/living/target, damage, damage_type, organ, armor)
|
||||
return
|
||||
|
||||
/mob/living/proc/unarmed_attacked(mob/living/attacker, damage, damage_type, zone)
|
||||
return
|
||||
@@ -12,25 +12,28 @@
|
||||
if(!damage || (blocked >= 2))
|
||||
return 0
|
||||
|
||||
var/damage_done = damage/(blocked+1)
|
||||
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
adjustBruteLoss(damage/(blocked+1))
|
||||
adjustBruteLoss(damage_done)
|
||||
if(BURN)
|
||||
if(M_RESIST_HEAT in mutations)
|
||||
damage = 0
|
||||
adjustFireLoss(damage/(blocked+1))
|
||||
damage_done = 0
|
||||
adjustFireLoss(damage_done)
|
||||
if(TOX)
|
||||
adjustToxLoss(damage/(blocked+1))
|
||||
adjustToxLoss(damage_done)
|
||||
if(OXY)
|
||||
adjustOxyLoss(damage/(blocked+1))
|
||||
adjustOxyLoss(damage_done)
|
||||
if(CLONE)
|
||||
adjustCloneLoss(damage/(blocked+1))
|
||||
adjustCloneLoss(damage_done)
|
||||
if(HALLOSS)
|
||||
adjustHalLoss(damage/(blocked+1))
|
||||
adjustHalLoss(damage_done)
|
||||
if(BRAIN)
|
||||
adjustBrainLoss(damage/(blocked+1))
|
||||
adjustBrainLoss(damage_done)
|
||||
updatehealth()
|
||||
return 1
|
||||
|
||||
return damage_done
|
||||
|
||||
|
||||
/mob/living/proc/apply_damages(var/brute = 0, var/burn = 0, var/tox = 0, var/oxy = 0, var/clone = 0, var/halloss = 0, var/def_zone = null, var/blocked = 0)
|
||||
|
||||
@@ -436,6 +436,9 @@
|
||||
O.emp_act(severity)
|
||||
..()
|
||||
|
||||
/mob/living/proc/get_organ(zone)
|
||||
return
|
||||
|
||||
/mob/living/proc/get_organ_target()
|
||||
var/t = src.zone_sel.selecting
|
||||
if ((t in list( "eyes", "mouth" )))
|
||||
|
||||
@@ -552,56 +552,18 @@ var/list/ai_list = list()
|
||||
updatehealth()
|
||||
return 2
|
||||
|
||||
/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if (!ticker)
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "No attacking people at spawn, you jackass.")
|
||||
return
|
||||
|
||||
/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M)
|
||||
switch(M.a_intent)
|
||||
|
||||
if (I_HELP)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='notice'>[M] caresses [src]'s plating with its scythe like arm.</span>"), 1)
|
||||
visible_message("<span class='notice'>[M] caresses [src]'s plating with its scythe like arm.</span>")
|
||||
|
||||
else //harm
|
||||
var/damage = rand(10, 20)
|
||||
if (prob(90))
|
||||
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has slashed at []!</span>", M, src), 1)
|
||||
if(M.unarmed_attack_mob(src))
|
||||
if(prob(8))
|
||||
flash_eyes(visual = 1, type = /obj/screen/fullscreen/flash/noise)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] took a swipe at []!</span>", M, src), 1)
|
||||
return
|
||||
|
||||
/mob/living/silicon/ai/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(!istype(M))
|
||||
return
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
if(M.attack_sound)
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<span class='warning'><B>[M]</B> [M.attacktext] [src]!</span>", 1)
|
||||
|
||||
add_logs(M, src, "attacked", admin = M.ckey ? TRUE : FALSE) //Only add this to the server logs if they're controlled by a player.
|
||||
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/silicon/ai/reset_view(atom/A)
|
||||
if (camera_light_on)
|
||||
|
||||
@@ -980,58 +980,18 @@
|
||||
to_chat(usr, "You unlock your cover.")
|
||||
|
||||
/mob/living/silicon/robot/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
|
||||
if (!ticker)
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
|
||||
if (istype(loc, /turf) && istype(loc.loc, /area/start))
|
||||
to_chat(M, "No attacking people at spawn, you jackass.")
|
||||
return
|
||||
|
||||
switch(M.a_intent)
|
||||
|
||||
if (I_HELP)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='notice'>[M] caresses [src]'s plating with its scythe like arm.</span>"), 1)
|
||||
visible_message("<span class='notice'>[M] caresses [src]'s plating with its scythe like arm.</span>")
|
||||
|
||||
if (I_GRAB)
|
||||
if (M.grab_check(src))
|
||||
return
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M,src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='attack'>[] has grabbed [] passively!</span>", M, src), 1)
|
||||
M.grab_mob(src)
|
||||
|
||||
if (I_HURT)
|
||||
var/damage = rand(10, 20)
|
||||
if (prob(90))
|
||||
/*
|
||||
if (M.class == "combat")
|
||||
damage += 15
|
||||
if(prob(20))
|
||||
knockdown = max(knockdown,4)
|
||||
stunned = max(stunned,4)
|
||||
What is this?*/
|
||||
|
||||
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message(text("<span class='danger'>[] has slashed at []!</span>", M, src), 1)
|
||||
if(M.unarmed_attack_mob(src))
|
||||
if(prob(8))
|
||||
flash_eyes(visual = 1, type = /obj/screen/fullscreen/flash/noise)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] took a swipe at []!</span>", M, src), 1)
|
||||
|
||||
if (I_DISARM)
|
||||
if(!(lying))
|
||||
@@ -1040,101 +1000,21 @@
|
||||
step(src,get_dir(M,src))
|
||||
spawn(5) step(src,get_dir(M,src))
|
||||
playsound(loc, 'sound/weapons/pierce.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] has forced back []!</span>", M, src), 1)
|
||||
visible_message("<span class='danger'>[M] has forced back [src]!</span>")
|
||||
else
|
||||
playsound(loc, 'sound/weapons/slashmiss.ogg', 25, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>[] attempted to force back []!</span>", M, src), 1)
|
||||
visible_message("<span class='danger'>[M] attempted to force back [src]!</span>")
|
||||
return
|
||||
|
||||
|
||||
|
||||
/mob/living/silicon/robot/attack_slime(mob/living/carbon/slime/M as mob)
|
||||
if (!ticker)
|
||||
to_chat(M, "You cannot attack people before the game has started.")
|
||||
return
|
||||
/mob/living/silicon/robot/attack_slime(mob/living/carbon/slime/M)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
if(M.Victim)
|
||||
return // can't attack while eating!
|
||||
/mob/living/silicon/robot/attack_animal(mob/living/simple_animal/M)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
if (health > -100)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>The [M.name] glomps []!</span>", src), 1)
|
||||
add_logs(M, src, "glomped on", 0)
|
||||
|
||||
var/damage = rand(1, 3)
|
||||
|
||||
if(istype(src, /mob/living/carbon/slime/adult))
|
||||
damage = rand(20, 40)
|
||||
else
|
||||
damage = rand(5, 35)
|
||||
|
||||
damage = round(damage / 2) // borgs recieve half damage
|
||||
adjustBruteLoss(damage)
|
||||
|
||||
|
||||
if(M.powerlevel > 0)
|
||||
var/stunprob = 10
|
||||
|
||||
switch(M.powerlevel)
|
||||
if(1 to 2)
|
||||
stunprob = 20
|
||||
if(3 to 4)
|
||||
stunprob = 30
|
||||
if(5 to 6)
|
||||
stunprob = 40
|
||||
if(7 to 8)
|
||||
stunprob = 60
|
||||
if(9)
|
||||
stunprob = 70
|
||||
if(10)
|
||||
stunprob = 95
|
||||
|
||||
if(prob(stunprob))
|
||||
M.powerlevel -= 3
|
||||
if(M.powerlevel < 0)
|
||||
M.powerlevel = 0
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='danger'>The [M.name] has electrified []!</span>", src), 1)
|
||||
|
||||
flash_eyes(visual = 1, type = /obj/screen/fullscreen/flash/noise)
|
||||
|
||||
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
|
||||
if (prob(stunprob) && M.powerlevel >= 8)
|
||||
adjustBruteLoss(M.powerlevel * rand(6,10))
|
||||
|
||||
|
||||
updatehealth()
|
||||
|
||||
return
|
||||
|
||||
/mob/living/silicon/robot/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
if(M.attack_sound)
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<span class='danger'>[M] [M.attacktext] [src]!</span>", 1)
|
||||
|
||||
add_logs(M, src, "attacked", admin = M.ckey ? TRUE : FALSE) //Only add this to the server logs if they're controlled by a player.
|
||||
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
adjustBruteLoss(damage)
|
||||
updatehealth()
|
||||
|
||||
|
||||
/mob/living/silicon/robot/attack_hand(mob/user)
|
||||
/mob/living/silicon/robot/attack_hand(mob/living/user)
|
||||
|
||||
add_fingerprint(user)
|
||||
|
||||
@@ -1155,15 +1035,19 @@
|
||||
cell_component.wrapped = null
|
||||
cell_component.installed = 0
|
||||
updateicon()
|
||||
return
|
||||
else if(cell_component.installed == -1)
|
||||
cell_component.installed = 0
|
||||
var/obj/item/broken_device = cell_component.wrapped
|
||||
to_chat(user, "You remove \the [broken_device].")
|
||||
user.put_in_active_hand(broken_device)
|
||||
return
|
||||
|
||||
if (user.a_intent == I_HELP)
|
||||
help_shake_act(user)
|
||||
return
|
||||
switch(user.a_intent)
|
||||
if(I_HELP)
|
||||
help_shake_act(user)
|
||||
if(I_HURT)
|
||||
user.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/silicon/robot/proc/allowed(mob/M)
|
||||
//check if it doesn't require any access at all
|
||||
|
||||
11
code/modules/mob/living/simple_animal/combat.dm
Normal file
11
code/modules/mob/living/simple_animal/combat.dm
Normal file
@@ -0,0 +1,11 @@
|
||||
/mob/living/simple_animal/get_unarmed_damage()
|
||||
return rand(melee_damage_lower, melee_damage_upper)
|
||||
|
||||
/mob/living/simple_animal/get_unarmed_damage_type()
|
||||
return melee_damage_type
|
||||
|
||||
/mob/living/simple_animal/get_unarmed_verb()
|
||||
return (melee_damage_upper == 0 ? friendly : attacktext)
|
||||
|
||||
/mob/living/simple_animal/get_unarmed_hit_sound()
|
||||
return attack_sound
|
||||
@@ -104,7 +104,7 @@
|
||||
to_chat(user, msg)
|
||||
|
||||
|
||||
/mob/living/simple_animal/construct/attack_animal(mob/living/simple_animal/M as mob)
|
||||
/mob/living/simple_animal/construct/attack_animal(mob/living/simple_animal/M)
|
||||
if(istype(M, /mob/living/simple_animal/construct/builder))
|
||||
if(src.health >= src.maxHealth)
|
||||
to_chat(M, "<span class='notice'>[src] has nothing to mend.</span>")
|
||||
@@ -112,17 +112,7 @@
|
||||
health = min(maxHealth, health + 5) // Constraining health to maxHealth
|
||||
M.visible_message("[M] mends some of \the <EM>[src]'s</EM> wounds.","You mend some of \the <em>[src]'s</em> wounds.")
|
||||
else
|
||||
add_logs(M, src, "attacked", admin = M.ckey ? TRUE : FALSE) //Only add this to the server logs if they're controlled by a player.
|
||||
|
||||
if(M.melee_damage_upper <= 0)
|
||||
M.emote("[M.friendly] \the <EM>[src]</EM>")
|
||||
else
|
||||
if(M.attack_sound)
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
M.visible_message("<span class='attack'>\The <EM>[M]</EM> [M.attacktext] \the <EM>[src]</EM>!</span>")
|
||||
add_logs(M, src, "attacked", admin=1)
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
adjustBruteLoss(damage)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/simple_animal/construct/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
user.delayNextAttack(8)
|
||||
|
||||
@@ -65,9 +65,9 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
|
||||
var/melee_damage_lower = 0
|
||||
var/melee_damage_upper = 0
|
||||
var/melee_damage_type = BRUTE
|
||||
var/attacktext = "attacks"
|
||||
var/attacktext = "attacked"
|
||||
var/attack_sound = null
|
||||
var/friendly = "nuzzles" //If the mob does no damage with it's attack
|
||||
var/friendly = "nuzzled" //If the mob does no damage with it's attack
|
||||
var/environment_smash = 0 //Set to 1 to allow breaking of crates,lockers,racks,tables; 2 for walls; 3 for Rwalls
|
||||
|
||||
var/speed = 0 //LETS SEE IF I CAN SET SPEEDS FOR SIMPLE MOBS WITHOUT DESTROYING EVERYTHING. Higher speed is slower, negative speed is faster
|
||||
@@ -344,23 +344,8 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
|
||||
act = "me"
|
||||
..(act, type, desc)
|
||||
|
||||
/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M as mob)
|
||||
if(M.melee_damage_upper == 0)
|
||||
M.emote("[M.friendly] [src]")
|
||||
else
|
||||
if(M.attack_sound)
|
||||
playsound(loc, M.attack_sound, 50, 1, 1)
|
||||
|
||||
visible_message("<span class='warning'><B>\The [M]</B> [M.attacktext] \the [src]!</span>")
|
||||
|
||||
add_logs(M, src, "attacked", admin = M.ckey ? TRUE : FALSE) //Only add this to the server logs if they're controlled by a player.
|
||||
|
||||
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
|
||||
if(M.melee_damage_type == "BRAIN") //because brain damage is apparently not a proper damage type like all the others
|
||||
adjustBrainLoss(damage)
|
||||
else
|
||||
adjustBruteLoss(damage,M.melee_damage_type)
|
||||
updatehealth()
|
||||
/mob/living/simple_animal/attack_animal(mob/living/simple_animal/M)
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/simple_animal/bullet_act(var/obj/item/projectile/Proj)
|
||||
if(!Proj)
|
||||
@@ -381,32 +366,17 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
|
||||
switch(M.a_intent)
|
||||
|
||||
if(I_HELP)
|
||||
if (health > 0)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message("<span class='notice'>[M] [response_help] [src].</span>")
|
||||
if(health > 0)
|
||||
visible_message("<span class='notice'>[M] [response_help] [src].</span>")
|
||||
|
||||
if(I_GRAB)
|
||||
if (M.grab_check(src))
|
||||
return
|
||||
if (!(status_flags & CANPUSH))
|
||||
return
|
||||
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M,src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
G.affecting = src
|
||||
LAssailant = M
|
||||
|
||||
visible_message("<span class='warning'>[M] has grabbed [src] passively!</span>")
|
||||
M.grab_mob(src)
|
||||
|
||||
if(I_HURT, I_DISARM)
|
||||
adjustBruteLoss(harm_intent_damage)
|
||||
M.unarmed_attack_mob(src)
|
||||
//adjustBruteLoss(harm_intent_damage)
|
||||
|
||||
visible_message("<span class='warning'>[M] [response_harm] [src]!</span>")
|
||||
//visible_message("<span class='warning'>[M] [response_harm] [src]!</span>")
|
||||
|
||||
return
|
||||
|
||||
@@ -429,36 +399,11 @@ var/global/list/animal_count = list() //Stores types, and amount of animals of t
|
||||
switch(M.a_intent)
|
||||
|
||||
if (I_HELP)
|
||||
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='notice'>[M] caresses [src] with its scythe like arm.</span>"), 1)
|
||||
visible_message("<span class='notice'>[M] caresses [src] with its scythe like arm.</span>")
|
||||
if (I_GRAB)
|
||||
if(M.grab_check(src))
|
||||
return
|
||||
if(!(status_flags & CANPUSH))
|
||||
return
|
||||
|
||||
var/obj/item/weapon/grab/G = getFromPool(/obj/item/weapon/grab,M,src)
|
||||
|
||||
M.put_in_active_hand(G)
|
||||
|
||||
grabbed_by += G
|
||||
G.synch()
|
||||
G.affecting = src
|
||||
LAssailant = M
|
||||
|
||||
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O.show_message(text("<span class='warning'>[] has grabbed [] passively!</span>", M, src), 1)
|
||||
|
||||
M.grab_mob(src)
|
||||
if(I_HURT, I_DISARM)
|
||||
var/damage = rand(15, 30)
|
||||
visible_message("<span class='danger'>[M] has slashed at [src]!</span>")
|
||||
adjustBruteLoss(damage)
|
||||
|
||||
return
|
||||
M.unarmed_attack_mob(src)
|
||||
|
||||
/mob/living/simple_animal/attack_larva(mob/living/carbon/alien/larva/L as mob)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user