mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Datumizes changelings and refactors related code (#17774)
* it's finally here unfucks tgui * oops, I don't want to change the mode * charlie and moxian review * charlie review II + some GC fixes * rebase to fix conflicts + tgui bundle deconflict * charlie review III + affected review * final? tweaks
This commit is contained in:
@@ -94,9 +94,7 @@
|
||||
|
||||
// Not-very-datumized antags follow
|
||||
// Associative list of antag name => whether this mind is this antag
|
||||
var/other_antags = list(
|
||||
"Changeling" = (mind.changeling != null)
|
||||
)
|
||||
var/list/other_antags = list()
|
||||
if(SSticker && SSticker.mode)
|
||||
other_antags += list(
|
||||
"Blob" = (mind.special_role == SPECIAL_ROLE_BLOB),
|
||||
|
||||
@@ -530,9 +530,10 @@
|
||||
follow = TRUE
|
||||
|
||||
/datum/language/ling/broadcast(mob/living/speaker, message, speaker_mask)
|
||||
if(speaker.mind && speaker.mind.changeling)
|
||||
..(speaker, message, speaker.mind.changeling.changelingID)
|
||||
else if(speaker.mind && speaker.mind.linglink)
|
||||
var/datum/antagonist/changeling/cling = speaker.mind?.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(cling)
|
||||
..(speaker, message, cling.changelingID)
|
||||
else if(speaker.mind?.linglink)
|
||||
..()
|
||||
else
|
||||
..(speaker,message)
|
||||
|
||||
@@ -208,9 +208,10 @@
|
||||
stat("Chemicals", B.chemicals)
|
||||
|
||||
if(mind)
|
||||
if(mind.changeling)
|
||||
stat("Chemical Storage", "[mind.changeling.chem_charges]/[mind.changeling.chem_storage]")
|
||||
stat("Absorbed DNA", mind.changeling.absorbedcount)
|
||||
var/datum/antagonist/changeling/cling = mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(cling)
|
||||
stat("Chemical Storage", "[cling.chem_charges]/[cling.chem_storage]")
|
||||
stat("Absorbed DNA", cling.absorbed_count)
|
||||
|
||||
var/datum/antagonist/vampire/V = mind.has_antag_datum(/datum/antagonist/vampire)
|
||||
if(V)
|
||||
|
||||
@@ -757,17 +757,6 @@
|
||||
if(!has_embedded_objects())
|
||||
clear_alert("embeddedobject")
|
||||
|
||||
/mob/living/carbon/human/handle_changeling()
|
||||
if(mind.changeling)
|
||||
mind.changeling.regenerate(src)
|
||||
if(hud_used)
|
||||
hud_used.lingchemdisplay.invisibility = 0
|
||||
hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font face='Small Fonts' color='#dd66dd'>[round(mind.changeling.chem_charges)]</font></div>"
|
||||
else
|
||||
if(hud_used)
|
||||
hud_used.lingchemdisplay.invisibility = 101
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/handle_pulse(times_fired)
|
||||
if(times_fired % 5 == 1)
|
||||
return pulse //update pulse every 5 life ticks (~1 tick/sec, depending on server load)
|
||||
|
||||
@@ -83,8 +83,10 @@
|
||||
if(has_changer)
|
||||
return has_changer
|
||||
|
||||
if(mind && mind.changeling && mind.changeling.mimicing)
|
||||
return mind.changeling.mimicing
|
||||
if(mind)
|
||||
var/datum/antagonist/changeling/cling = mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(cling?.mimicing)
|
||||
return cling.mimicing
|
||||
|
||||
if(GetSpecialVoice())
|
||||
return GetSpecialVoice()
|
||||
|
||||
@@ -25,8 +25,7 @@
|
||||
|
||||
if(LAZYLEN(processing_patches))
|
||||
handle_patches()
|
||||
if(mind)
|
||||
handle_changeling()
|
||||
|
||||
handle_wetness(times_fired)
|
||||
|
||||
// Increase germ_level regularly
|
||||
@@ -221,9 +220,6 @@
|
||||
/mob/living/carbon/proc/handle_blood()
|
||||
return
|
||||
|
||||
/mob/living/carbon/proc/handle_changeling()
|
||||
return
|
||||
|
||||
/mob/living/carbon/handle_mutations_and_radiation()
|
||||
radiation -= min(radiation, RAD_LOSS_PER_TICK)
|
||||
if(radiation > RAD_MOB_SAFE)
|
||||
|
||||
@@ -204,21 +204,21 @@
|
||||
//basic fast checks go first. When overriding this proc, I recommend calling ..() at the end.
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return 0
|
||||
return FALSE
|
||||
if(!is_level_reachable(T.z))
|
||||
return 0
|
||||
if(user != null && src == user)
|
||||
return 0
|
||||
return FALSE
|
||||
if(!isnull(user) && src == user)
|
||||
return FALSE
|
||||
if(invisibility || alpha == 0)//cloaked
|
||||
return 0
|
||||
if(digitalcamo)
|
||||
return 0
|
||||
return FALSE
|
||||
if(HAS_TRAIT(src, TRAIT_AI_UNTRACKABLE))
|
||||
return FALSE
|
||||
|
||||
// Now, are they viewable by a camera? (This is last because it's the most intensive check)
|
||||
if(!near_camera(src))
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
//mob verbs are a lot faster than object verbs
|
||||
//for more info on why this is not atom/pull, see examinate() in mob.dm
|
||||
|
||||
@@ -18,14 +18,6 @@
|
||||
if(ranged_ability)
|
||||
ranged_ability.add_ranged_ability(src, "<span class='notice'>You currently have <b>[ranged_ability]</b> active!</span>")
|
||||
|
||||
//for when action buttons are lost and need to be regained, such as when the mind enters a new mob
|
||||
var/datum/changeling/changeling = usr.mind.changeling
|
||||
if(changeling)
|
||||
for(var/power in changeling.purchasedpowers)
|
||||
var/datum/action/changeling/S = power
|
||||
if(istype(S) && S.needs_button)
|
||||
S.Grant(src)
|
||||
|
||||
//Should update regardless of if we can ventcrawl, since we can end up in pipes in other ways.
|
||||
update_pipe_vision()
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
SSticker.mode.remove_revolutionary(mind, 1)
|
||||
SSticker.mode.remove_cultist(mind, 1)
|
||||
SSticker.mode.remove_wizard(mind)
|
||||
SSticker.mode.remove_changeling(mind)
|
||||
mind.remove_antag_datum(/datum/antagonist/changeling)
|
||||
mind.remove_antag_datum(/datum/antagonist/vampire)
|
||||
SSticker.mode.remove_abductor(mind)
|
||||
..()
|
||||
|
||||
@@ -56,7 +56,7 @@
|
||||
return
|
||||
Infect(target)
|
||||
to_chat(src, "<span class='userdanger'>With our egg laid, our death approaches rapidly...</span>")
|
||||
addtimer(CALLBACK(src, .proc/death), 100)
|
||||
addtimer(CALLBACK(src, .proc/death), 10 SECONDS)
|
||||
|
||||
/obj/item/organ/internal/body_egg/changeling_egg
|
||||
name = "changeling egg"
|
||||
@@ -70,7 +70,7 @@
|
||||
time++
|
||||
if(time >= EGG_INCUBATION_TIME)
|
||||
Pop()
|
||||
remove(owner)
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/organ/internal/body_egg/changeling_egg/proc/Pop()
|
||||
@@ -82,17 +82,25 @@
|
||||
|
||||
if(origin && origin.current && (origin.current.stat == DEAD))
|
||||
origin.transfer_to(M)
|
||||
if(!origin.changeling)
|
||||
M.make_changeling()
|
||||
if(origin.changeling.can_absorb_dna(M, owner))
|
||||
origin.changeling.absorb_dna(owner, M)
|
||||
var/datum/antagonist/changeling/cling = M.mind.has_antag_datum(/datum/antagonist/changeling)
|
||||
if(cling.can_absorb_dna(owner))
|
||||
cling.absorb_dna(owner)
|
||||
|
||||
var/datum/action/changeling/humanform/HF = new
|
||||
HF.Grant(M)
|
||||
for(var/power in origin.changeling.purchasedpowers)
|
||||
var/datum/action/changeling/S = power
|
||||
if(istype(S) && S.needs_button)
|
||||
S.Grant(M)
|
||||
cling.update_languages()
|
||||
|
||||
// When they became a headslug, power typepaths were added to this list, so we need to make new ones from the paths.
|
||||
for(var/power_path in cling.acquired_powers)
|
||||
cling.give_power(new power_path, M, FALSE)
|
||||
cling.acquired_powers -= power_path
|
||||
|
||||
var/datum/action/changeling/evolution_menu/E = locate() in cling.acquired_powers
|
||||
|
||||
// Add purchasable powers they have back to the evolution menu's purchased list.
|
||||
for(var/datum/action/changeling/power as anything in cling.acquired_powers)
|
||||
if(power.power_type == CHANGELING_PURCHASABLE_POWER)
|
||||
E.purchased_abilities += power.type
|
||||
|
||||
cling.give_power(new /datum/action/changeling/humanform)
|
||||
M.key = origin.key
|
||||
owner.gib()
|
||||
|
||||
|
||||
@@ -157,8 +157,6 @@
|
||||
|
||||
var/area/lastarea = null
|
||||
|
||||
var/digitalcamo = 0 // Can they be tracked by the AI?
|
||||
|
||||
var/has_unlimited_silicon_privilege = 0 // Can they interact with station electronics
|
||||
|
||||
var/atom/movable/remote_control //Calls relaymove() to whatever it is
|
||||
|
||||
Reference in New Issue
Block a user