mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Adds event/shenanigans vareditable shapeshifter mechanic (#6902)
This commit is contained in:
@@ -302,6 +302,10 @@
|
|||||||
if((direct & (direct - 1)) && mob.loc == n)
|
if((direct & (direct - 1)) && mob.loc == n)
|
||||||
my_mob.setMoveCooldown(total_delay * SQRT_2) //CHOMPEDIT
|
my_mob.setMoveCooldown(total_delay * SQRT_2) //CHOMPEDIT
|
||||||
|
|
||||||
|
if(!isliving(my_mob)) //CHOMPAdd
|
||||||
|
moving = 0
|
||||||
|
return
|
||||||
|
|
||||||
// If we have a grab
|
// If we have a grab
|
||||||
var/list/grablist = my_mob.ret_grab()
|
var/list/grablist = my_mob.ret_grab()
|
||||||
if(LAZYLEN(grablist))
|
if(LAZYLEN(grablist))
|
||||||
|
|||||||
@@ -98,6 +98,9 @@
|
|||||||
var/datum/ai_holder/our_AI = ourmob.ai_holder
|
var/datum/ai_holder/our_AI = ourmob.ai_holder
|
||||||
our_AI.set_stance(STANCE_IDLE)
|
our_AI.set_stance(STANCE_IDLE)
|
||||||
M.tf_mob_holder = null
|
M.tf_mob_holder = null
|
||||||
|
var/ourmob_ckey //CHOMPEdit Start
|
||||||
|
if(ourmob.ckey)
|
||||||
|
ourmob_ckey = ourmob.ckey
|
||||||
ourmob.ckey = M.ckey
|
ourmob.ckey = M.ckey
|
||||||
var/turf/get_dat_turf = get_turf(target)
|
var/turf/get_dat_turf = get_turf(target)
|
||||||
ourmob.loc = get_dat_turf
|
ourmob.loc = get_dat_turf
|
||||||
@@ -118,7 +121,13 @@
|
|||||||
continue
|
continue
|
||||||
M.drop_from_inventory(W)
|
M.drop_from_inventory(W)
|
||||||
|
|
||||||
qdel(target)
|
if(M.tf_form == ourmob)
|
||||||
|
if(ourmob_ckey)
|
||||||
|
M.ckey = ourmob_ckey
|
||||||
|
ourmob.tf_form = M
|
||||||
|
M.forceMove(ourmob)
|
||||||
|
else
|
||||||
|
qdel(target) //CHOMPEdit End
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
if(M.stat == DEAD) //We can let it undo the TF, because the person will be dead, but otherwise things get weird.
|
if(M.stat == DEAD) //We can let it undo the TF, because the person will be dead, but otherwise things get weird.
|
||||||
@@ -186,6 +195,9 @@
|
|||||||
var/datum/ai_holder/our_AI = ourmob.ai_holder
|
var/datum/ai_holder/our_AI = ourmob.ai_holder
|
||||||
our_AI.set_stance(STANCE_IDLE)
|
our_AI.set_stance(STANCE_IDLE)
|
||||||
tf_mob_holder = null
|
tf_mob_holder = null
|
||||||
|
var/ourmob_ckey //CHOMPEdit Start
|
||||||
|
if(ourmob.ckey)
|
||||||
|
ourmob_ckey = ourmob.ckey
|
||||||
ourmob.ckey = ckey
|
ourmob.ckey = ckey
|
||||||
var/turf/get_dat_turf = get_turf(src)
|
var/turf/get_dat_turf = get_turf(src)
|
||||||
ourmob.loc = get_dat_turf
|
ourmob.loc = get_dat_turf
|
||||||
@@ -207,7 +219,13 @@
|
|||||||
continue
|
continue
|
||||||
src.drop_from_inventory(W)
|
src.drop_from_inventory(W)
|
||||||
|
|
||||||
qdel(src)
|
if(tf_form == ourmob)
|
||||||
|
if(ourmob_ckey)
|
||||||
|
src.ckey = ourmob_ckey
|
||||||
|
ourmob.tf_form = src
|
||||||
|
src.forceMove(ourmob)
|
||||||
|
else
|
||||||
|
qdel(src) //CHOMPEdit End
|
||||||
|
|
||||||
|
|
||||||
/mob/living/proc/handle_tf_holder()
|
/mob/living/proc/handle_tf_holder()
|
||||||
@@ -309,6 +327,9 @@
|
|||||||
var/datum/ai_holder/our_AI = ourmob.ai_holder
|
var/datum/ai_holder/our_AI = ourmob.ai_holder
|
||||||
our_AI.set_stance(STANCE_IDLE)
|
our_AI.set_stance(STANCE_IDLE)
|
||||||
M.tf_mob_holder = null
|
M.tf_mob_holder = null
|
||||||
|
var/ourmob_ckey //CHOMPEdit Start
|
||||||
|
if(ourmob.ckey)
|
||||||
|
ourmob_ckey = ourmob.ckey
|
||||||
ourmob.ckey = M.ckey
|
ourmob.ckey = M.ckey
|
||||||
var/turf/get_dat_turf = get_turf(target)
|
var/turf/get_dat_turf = get_turf(target)
|
||||||
ourmob.loc = get_dat_turf
|
ourmob.loc = get_dat_turf
|
||||||
@@ -330,7 +351,13 @@
|
|||||||
continue
|
continue
|
||||||
M.drop_from_inventory(W)
|
M.drop_from_inventory(W)
|
||||||
|
|
||||||
qdel(target)
|
if(M.tf_form == ourmob)
|
||||||
|
if(ourmob_ckey)
|
||||||
|
M.ckey = ourmob_ckey
|
||||||
|
ourmob.tf_form = M
|
||||||
|
M.forceMove(ourmob)
|
||||||
|
else
|
||||||
|
qdel(target) //CHOMPEdit End
|
||||||
firer.visible_message("<span class='notice'>\The [shot_from] boops pleasantly.</span>")
|
firer.visible_message("<span class='notice'>\The [shot_from] boops pleasantly.</span>")
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
var/death_sound_override = null
|
var/death_sound_override = null
|
||||||
var/virtual_reality_mob = FALSE // gross boolean for keeping VR mobs in VR
|
var/virtual_reality_mob = FALSE // gross boolean for keeping VR mobs in VR
|
||||||
var/datum/looping_sound/mob/on_fire/firesoundloop
|
var/datum/looping_sound/mob/on_fire/firesoundloop
|
||||||
|
var/mob/living/tf_form // Shapeshifter shenanigans
|
||||||
// var/datum/looping_sound/mob/stunned/stunnedloop
|
// var/datum/looping_sound/mob/stunned/stunnedloop
|
||||||
/* // Not sure if needed, screams aren't a carbon thing rn.
|
/* // Not sure if needed, screams aren't a carbon thing rn.
|
||||||
var/scream_sound = null
|
var/scream_sound = null
|
||||||
@@ -92,7 +93,7 @@ Maybe later, gotta figure out a way to click yourself when in a locker etc.
|
|||||||
// For some reason upstream made a general revert proc but not a general transform proc, so here it is.
|
// For some reason upstream made a general revert proc but not a general transform proc, so here it is.
|
||||||
// Requires a /mob/living type path for transformation. Returns the new mob on success, null in all other cases.
|
// Requires a /mob/living type path for transformation. Returns the new mob on success, null in all other cases.
|
||||||
// Just handles mob TF right now, but maybe we'll want to do something similar for items in the future.
|
// Just handles mob TF right now, but maybe we'll want to do something similar for items in the future.
|
||||||
/mob/living/proc/transform_into_mob(mob/living/new_form, pref_override = FALSE, revert = FALSE)
|
/mob/living/proc/transform_into_mob(mob/living/new_form, pref_override = FALSE, revert = FALSE, shapeshifting = FALSE)
|
||||||
if(!src.mind)
|
if(!src.mind)
|
||||||
return
|
return
|
||||||
if(!src.allow_spontaneous_tf && !pref_override)
|
if(!src.allow_spontaneous_tf && !pref_override)
|
||||||
@@ -106,9 +107,19 @@ Maybe later, gotta figure out a way to click yourself when in a locker etc.
|
|||||||
else
|
else
|
||||||
if(src.stat == DEAD)
|
if(src.stat == DEAD)
|
||||||
return
|
return
|
||||||
if(!ispath(new_form, /mob/living))
|
if(!ispath(new_form, /mob/living) && !ismob(new_form))
|
||||||
return
|
return
|
||||||
var/mob/living/new_mob = new new_form(get_turf(src))
|
var/mob/living/new_mob
|
||||||
|
var/new_mob_ckey
|
||||||
|
if(shapeshifting && src.tf_form)
|
||||||
|
new_mob = src.tf_form
|
||||||
|
new_mob.verbs |= /mob/living/proc/shapeshift_form
|
||||||
|
new_mob.tf_form = src
|
||||||
|
new_mob.forceMove(src.loc)
|
||||||
|
if(new_mob.ckey)
|
||||||
|
new_mob_ckey = new_mob.ckey
|
||||||
|
else
|
||||||
|
new_mob = new new_form(get_turf(src))
|
||||||
new_mob.faction = src.faction
|
new_mob.faction = src.faction
|
||||||
|
|
||||||
if(new_mob && isliving(new_mob))
|
if(new_mob && isliving(new_mob))
|
||||||
@@ -144,6 +155,8 @@ Maybe later, gotta figure out a way to click yourself when in a locker etc.
|
|||||||
new_mob.vore_organs += B
|
new_mob.vore_organs += B
|
||||||
|
|
||||||
new_mob.ckey = src.ckey
|
new_mob.ckey = src.ckey
|
||||||
|
if(new_mob_ckey)
|
||||||
|
src.ckey = new_mob_ckey
|
||||||
if(src.ai_holder && new_mob.ai_holder)
|
if(src.ai_holder && new_mob.ai_holder)
|
||||||
var/datum/ai_holder/old_AI = src.ai_holder
|
var/datum/ai_holder/old_AI = src.ai_holder
|
||||||
old_AI.set_stance(STANCE_SLEEP)
|
old_AI.set_stance(STANCE_SLEEP)
|
||||||
@@ -154,3 +167,13 @@ Maybe later, gotta figure out a way to click yourself when in a locker etc.
|
|||||||
src.forceMove(new_mob)
|
src.forceMove(new_mob)
|
||||||
new_mob.tf_mob_holder = src
|
new_mob.tf_mob_holder = src
|
||||||
return new_mob
|
return new_mob
|
||||||
|
|
||||||
|
/mob/living/proc/shapeshift_form()
|
||||||
|
set name = "Shapeshift Form"
|
||||||
|
set category = "Abilities"
|
||||||
|
set desc = "Shape shift between set mob forms. (Requires a spawned mob to be varedited into the user's tf_form var as mob reference.)"
|
||||||
|
if(!istype(tf_form))
|
||||||
|
to_chat(src, "<span class='notice'>No shapeshift form set. (Requires a spawned mob to be varedited into the user's tf_form var as mob reference.)</span>")
|
||||||
|
return
|
||||||
|
else
|
||||||
|
transform_into_mob(tf_form, TRUE, TRUE, TRUE)
|
||||||
Reference in New Issue
Block a user