mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 06:57:42 +01:00
override apply_damage, revert set_species changes, allow admemes to convert living people
This commit is contained in:
@@ -1305,13 +1305,8 @@
|
||||
oldspecies.handle_dna(src, TRUE) // Remove any genes that belong to the old species
|
||||
|
||||
oldspecies.on_species_loss(src)
|
||||
var/datum/species/new_race
|
||||
if(ispath(new_species))
|
||||
new_race = new new_species
|
||||
else if(istype(new_species))
|
||||
new_race = new_species
|
||||
|
||||
dna.species = new_race
|
||||
dna.species = new new_species()
|
||||
|
||||
tail = dna.species.tail
|
||||
|
||||
|
||||
@@ -335,57 +335,4 @@ This function restores all organs.
|
||||
//Handle BRUTE and BURN damage
|
||||
handle_suit_punctures(damagetype, damage)
|
||||
//Handle species apply_damage procs
|
||||
dna.species.spec_apply_damage(damage, damagetype, def_zone, blocked, sharp, used_weapon)
|
||||
|
||||
blocked = (100 - blocked) / 100
|
||||
if(blocked <= 0)
|
||||
return 0
|
||||
|
||||
var/obj/item/organ/external/organ = null
|
||||
if(isorgan(def_zone))
|
||||
organ = def_zone
|
||||
else
|
||||
if(!def_zone)
|
||||
def_zone = ran_zone(def_zone)
|
||||
organ = get_organ(check_zone(def_zone))
|
||||
if(!organ)
|
||||
return 0
|
||||
|
||||
damage = damage * blocked
|
||||
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
damageoverlaytemp = 20
|
||||
if(dna.species)
|
||||
damage = damage * dna.species.brute_mod
|
||||
|
||||
if(organ.receive_damage(damage, 0, sharp, used_weapon))
|
||||
UpdateDamageIcon()
|
||||
|
||||
if(LAssailant && ishuman(LAssailant)) //superheros still get the comical hit markers
|
||||
var/mob/living/carbon/human/H = LAssailant
|
||||
if(H.mind && H.mind in (SSticker.mode.superheroes || SSticker.mode.supervillains || SSticker.mode.greyshirts))
|
||||
var/list/attack_bubble_recipients = list()
|
||||
var/mob/living/user
|
||||
for(var/mob/O in viewers(user, src))
|
||||
if(O.client && O.has_vision(information_only=TRUE))
|
||||
attack_bubble_recipients.Add(O.client)
|
||||
spawn(0)
|
||||
var/image/dmgIcon = image('icons/effects/hit_blips.dmi', src, "dmg[rand(1,2)]",MOB_LAYER+1)
|
||||
dmgIcon.pixel_x = (!lying) ? rand(-3,3) : rand(-11,12)
|
||||
dmgIcon.pixel_y = (!lying) ? rand(-11,9) : rand(-10,1)
|
||||
flick_overlay(dmgIcon, attack_bubble_recipients, 9)
|
||||
|
||||
|
||||
if(BURN)
|
||||
damageoverlaytemp = 20
|
||||
|
||||
if(dna.species)
|
||||
damage = damage * dna.species.burn_mod
|
||||
|
||||
if(organ.receive_damage(0, damage, sharp, used_weapon))
|
||||
UpdateDamageIcon()
|
||||
|
||||
// Will set our damageoverlay icon to the next level, which will then be set back to the normal level the next mob.Life().
|
||||
updatehealth("apply damage")
|
||||
return 1
|
||||
return dna.species.apply_damage(damage, damagetype, def_zone, blocked, src, sharp, used_weapon)
|
||||
|
||||
@@ -311,8 +311,56 @@
|
||||
/datum/species/proc/spec_death(gibbed, mob/living/carbon/human/C)
|
||||
return
|
||||
|
||||
/datum/species/proc/spec_apply_damage(damage = 0, damagetype = BRUTE, def_zone = null, blocked = 0, sharp = 0, obj/used_weapon = null)
|
||||
return
|
||||
/datum/species/proc/apply_damage(damage = 0, damagetype = BRUTE, def_zone = null, blocked = 0, mob/living/carbon/human/H, sharp = 0, obj/used_weapon = null)
|
||||
blocked = (100 - blocked) / 100
|
||||
if(blocked <= 0)
|
||||
return 0
|
||||
|
||||
var/obj/item/organ/external/organ = null
|
||||
if(isorgan(def_zone))
|
||||
organ = def_zone
|
||||
else
|
||||
if(!def_zone)
|
||||
def_zone = ran_zone(def_zone)
|
||||
organ = H.get_organ(check_zone(def_zone))
|
||||
if(!organ)
|
||||
return 0
|
||||
|
||||
damage = damage * blocked
|
||||
|
||||
switch(damagetype)
|
||||
if(BRUTE)
|
||||
H.damageoverlaytemp = 20
|
||||
damage = damage * brute_mod
|
||||
|
||||
if(organ.receive_damage(damage, 0, sharp, used_weapon))
|
||||
H.UpdateDamageIcon()
|
||||
|
||||
if(H.LAssailant && ishuman(H.LAssailant)) //superheros still get the comical hit markers
|
||||
var/mob/living/carbon/human/A = H.LAssailant
|
||||
if(A.mind && A.mind in (SSticker.mode.superheroes || SSticker.mode.supervillains || SSticker.mode.greyshirts))
|
||||
var/list/attack_bubble_recipients = list()
|
||||
var/mob/living/user
|
||||
for(var/mob/O in viewers(user, src))
|
||||
if(O.client && O.has_vision(information_only=TRUE))
|
||||
attack_bubble_recipients.Add(O.client)
|
||||
spawn(0)
|
||||
var/image/dmgIcon = image('icons/effects/hit_blips.dmi', src, "dmg[rand(1,2)]",MOB_LAYER+1)
|
||||
dmgIcon.pixel_x = (!H.lying) ? rand(-3,3) : rand(-11,12)
|
||||
dmgIcon.pixel_y = (!H.lying) ? rand(-11,9) : rand(-10,1)
|
||||
flick_overlay(dmgIcon, attack_bubble_recipients, 9)
|
||||
|
||||
|
||||
if(BURN)
|
||||
H.damageoverlaytemp = 20
|
||||
damage = damage * burn_mod
|
||||
|
||||
if(organ.receive_damage(0, damage, sharp, used_weapon))
|
||||
H.UpdateDamageIcon()
|
||||
|
||||
// Will set our damageoverlay icon to the next level, which will then be set back to the normal level the next mob.Life().
|
||||
H.updatehealth("apply damage")
|
||||
return 1
|
||||
|
||||
/datum/species/proc/spec_stun(mob/living/carbon/human/H,amount)
|
||||
return
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
/datum/species/zombie/infectious/spec_stun(mob/living/carbon/human/H, amount)
|
||||
. = min(20, amount)
|
||||
|
||||
/datum/species/zombie/infectious/spec_apply_damage(damage = 0, damagetype = BRUTE, def_zone = null, blocked = 0, sharp = 0, obj/used_weapon = null)
|
||||
/datum/species/zombie/infectious/apply_damage(damage = 0, damagetype = BRUTE, def_zone = null, blocked = 0, sharp = 0, obj/used_weapon = null)
|
||||
. = ..()
|
||||
if(damage)
|
||||
regen_cooldown = world.time + REGENERATION_DELAY
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
parent_organ = "head"
|
||||
slot = "zombie_infection"
|
||||
icon_state = "blacktumor"
|
||||
var/converts_living = FALSE
|
||||
var/causes_damage = TRUE
|
||||
var/datum/species/old_species = /datum/species/human
|
||||
var/living_transformation_time = 3
|
||||
@@ -45,7 +46,7 @@
|
||||
return
|
||||
if(owner.suiciding)
|
||||
return
|
||||
if(owner.stat != DEAD)
|
||||
if(owner.stat != DEAD && !converts_living)
|
||||
return
|
||||
if(causes_damage && !iszombie(owner) && owner.stat != DEAD)
|
||||
owner.adjustToxLoss(1)
|
||||
@@ -63,7 +64,7 @@
|
||||
|
||||
/obj/item/organ/internal/zombie_infection/proc/zombify()
|
||||
timer_id = null
|
||||
if(owner.stat != DEAD)
|
||||
if(owner.stat != DEAD && !converts_living)
|
||||
return
|
||||
|
||||
if(!iszombie(owner))
|
||||
|
||||
Reference in New Issue
Block a user