Files
Paradise/code/datums/spells/shapeshift.dm
T
05791861b7 New PVE Major Midround: Demonic Incursion (#29053)
* Initial commit. Event.

* Started converting mobs to basic mobs. Migo and Creature. Needs aggressiveness AI

* Makes CI happy

* Fixes some file names

* Ticks files

* Fixes file again

* Update code/modules/events/demon_incursion.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>

* Announcement sound, spawn adjustments

* Reduced spread when portals multiply

* Elite spawns when portal count gets high

* Fixes missing comma

* Converted migo, blank, and most of hellhounds to basic mobs. Added new controllers and behaviors

* Fixes

* Linters!

* Faithless moved to basic mob

* LINTERS

* Makes skeletons basic mobs

* Fixes, Ranged Attacks, Ranged variants of nether mobs

* Handles portal expansion chance

* Linters

* Fixes mobs not breaking shit

* Fixes ranged attacks

* Fixes ranged attacks

* oops

* Another oops. No config changes are needed here

* Twenty percent chance that a nether mob is a grappler

* Dimensional tear fixes

* Adjusts awaken distance for hostile mobs, makes variable melee attack rate for basic mobs

* Variable initial spawns, variable spread rates.

* Whole lot of fixes from merge, hellhound completion

* Updated lavaland winter biodome

* Makes basic mobs able to hurt other mobs

* Makes spawners properly rally basic mobs to beat up the attacker

* Extra line

* Removed comment

* Makes hellhounds stop resting when attacked or when they find a new target

* Fixed initial portal spawn amounts

* Borgs now affected by basic mobs

* Nerfs portal spawn rate, nerfs portal integrity, nerfs portal max mobs

* Grapplers now teleport to missed turfs

* Removes duplicate notices

* Buff portals a small bit

* Makes nether portals no longer RR - the body is now recoverable from the blank it became

* Makes portals layer above mobs

* Removed excess ranged attack var

* Changes list for determining start count to rely on mobs with client instead of all clients

* Nerfs portal max mobs

* Portals can no longer spread to within 3 tiles of another portal except on initial event start

* Adjusts target portal count for big mobs

* Spawners now properly remove nest values of basic mobs

* Portals now glow an evil red. When portals are destroyed, 50% chance per mob to slay the mob

* add prowling and return to home behaviors

* cut this down

* be a tiny bit smarter

* Some code cleanup

* Removes hostile base type, removing excess code

* Gives /obj/ a basic mob attack handler. Fixes turrets

* Gives basic mobs a HUD

* Fixes skeleton death flag

* Adjusted initial spawns

* Incursion portals now slowly convert turfs, up to range 3 of them, to hellish flooring

* Increases reward per destroyed portal

* Makes the final portal of an incursion play a sound on destruction, couple portal fixes

* Fixes basic mob xenobiology interactions

* Non-shit portal sprites

* Adds hostile machine element, mobs now actively target turrets and emitters

* Properly gibs things when they should gib

* Linter fix

* Portals now layer under living mobs but over dead ones

* Adds blackbox checking for demon incursion portal counts

* Increases mob sight range slightly to account for widescreen, adds alt-color for grappler, delays incursion announcement a bit more

* Portals now are more likely to spread the less there are

* Incursion portals now repair themselves after not being damaged for some time

* Grilles now shock basic mobs

* Portals will now clean up basic mob corpses near them by gibbing them

* Portal spread chance is now exponential regression

* Portal mob spawns now linearly scale in time

* Fixes some skeleton oversights in ruin mapping

* Demon incursions no longer can spread to tiles in a space area, such as near brig plating

* Moves corpse cleanup to mobs via component

* Portals now drop bodies that are being eaten when they're destroyed.

* Addresses code review

* Docs some vars

---------

Signed-off-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: warriorstar-orion <orion@snowfrost.garden>
2025-07-16 00:19:23 +00:00

126 lines
4.4 KiB
Plaintext

/datum/spell/shapeshift
name = "Shapechange"
desc = "Take on the shape of another for a time to use their natural abilities. Once you've made your choice it cannot be changed."
clothes_req = FALSE
human_req = FALSE
base_cooldown = 200
cooldown_min = 50
invocation = "RAC'WA NO!"
invocation_type = "shout"
action_icon_state = "shapeshift"
var/shapeshift_type
var/list/current_shapes = list()
var/list/current_casters = list()
var/list/possible_shapes = list(/mob/living/simple_animal/mouse,
/mob/living/simple_animal/pet/dog/corgi,
/mob/living/simple_animal/bot/ed209,
/mob/living/simple_animal/hostile/construct/armoured)
/datum/spell/shapeshift/create_new_targeting()
return new /datum/spell_targeting/self
/datum/spell/shapeshift/cast(list/targets, mob/user = usr)
for(var/mob/living/M in targets)
if(!shapeshift_type)
var/list/animal_list = list()
for(var/path in possible_shapes)
var/mob/living/simple_animal/A = path
animal_list[initial(A.name)] = path
shapeshift_type = tgui_input_list(M, "Choose Your Animal Form!", "It's Morphing Time!", animal_list)
if(!shapeshift_type) //If you aren't gonna decide I am!
shapeshift_type = pick(animal_list)
shapeshift_type = animal_list[shapeshift_type]
if(M in current_shapes)
Restore(M)
else
Shapeshift(M)
/datum/spell/shapeshift/proc/Shapeshift(mob/living/caster)
for(var/mob/living/M in caster)
if(M.status_flags & GODMODE)
to_chat(caster, "<span class='warning'>You're already shapeshifted!</span>")
return
var/mob/living/shape = new shapeshift_type(get_turf(caster))
caster.forceMove(shape)
caster.status_flags |= GODMODE
current_shapes |= shape
current_casters |= caster
clothes_req = FALSE
human_req = FALSE
caster.mind.transfer_to(shape)
/datum/spell/shapeshift/proc/Restore(mob/living/shape)
var/mob/living/caster
for(var/mob/living/M in shape)
if(M in current_casters)
caster = M
break
if(!caster)
return
caster.forceMove(get_turf(shape))
caster.status_flags &= ~GODMODE
clothes_req = initial(clothes_req)
human_req = initial(human_req)
current_casters.Remove(caster)
current_shapes.Remove(shape)
shape.mind.transfer_to(caster)
qdel(shape) //Gib it maybe ?
/datum/spell/shapeshift/dragon
name = "Dragon Form"
desc = "Take on the shape a lesser ash drake after a short delay."
invocation = "*scream"
shapeshift_type = /mob/living/simple_animal/hostile/megafauna/dragon/lesser
current_shapes = list(/mob/living/simple_animal/hostile/megafauna/dragon/lesser)
current_casters = list()
possible_shapes = list(/mob/living/simple_animal/hostile/megafauna/dragon/lesser)
/datum/spell/shapeshift/dragon/Shapeshift(mob/living/caster)
caster.visible_message("<span class='danger'>[caster] screams in agony as bones and claws erupt out of their flesh!</span>",
"<span class='danger'>You begin channeling the transformation.</span>")
if(!do_after(caster, 5 SECONDS, FALSE, caster))
to_chat(caster, "<span class='warning'>You lose concentration of the spell!</span>")
return
return ..()
/datum/spell/shapeshift/bats
name = "Bat Form"
desc = "Take on the shape of a swarm of bats."
invocation = "none"
invocation_type = "none"
action_icon_state = "vampire_bats"
gain_desc = "You have gained the ability to shapeshift into bat form. This is a weak form with no abilities, only useful for stealth."
shapeshift_type = /mob/living/simple_animal/hostile/scarybat/adminvampire
current_shapes = list(/mob/living/simple_animal/hostile/scarybat/adminvampire)
current_casters = list()
possible_shapes = list(/mob/living/simple_animal/hostile/scarybat/adminvampire)
/datum/spell/shapeshift/hellhound
name = "Lesser Hellhound Form"
desc = "Take on the shape of a Hellhound."
invocation = "none"
invocation_type = "none"
action_background_icon_state = "bg_demon"
action_icon_state = "glare"
gain_desc = "You have gained the ability to shapeshift into lesser hellhound form. This is a combat form with different abilities, tough but not invincible. It can regenerate itself over time by resting."
shapeshift_type = /mob/living/basic/hellhound
current_shapes = list(/mob/living/basic/hellhound)
current_casters = list()
possible_shapes = list(/mob/living/basic/hellhound)
/datum/spell/shapeshift/hellhound/greater
name = "Greater Hellhound Form"
shapeshift_type = /mob/living/basic/hellhound/greater
current_shapes = list(/mob/living/basic/hellhound/greater)
current_casters = list()
possible_shapes = list(/mob/living/basic/hellhound/greater)