Files
Paradise/code/modules/projectiles/projectile/magic.dm
Mike Long 29c9aca1a8 Devil game mode
Fixes more compile errors.  Down to 65 now.

updates << into to_chat

Down to 60 errors, also starts to port the codex gigas and law 666 for cyborg devils.

Fixes more compile errors.  Down to 41 now.

Replaces timers with spawns, and <<s with to_chats
40 compile errors.

Down to 34 compile errors.

whoops, actually down to 34 now.

Down to 25 compile errors.

Down to 15 compile errors, I'llprobably need some help at this point.

Woo!  Down to 7 compile errors.

Ported over devil hud.  Number of errors up to 19.

WOO!  It compiles.  It's completely untested, but it compiles.

Adds devils to traitor panel

Implements iron, silver and salt banes.

implements flashing lights bane

Selling your soul prevents cloning, and some other methods of revival.

Implements harvest bane

Merged and sorted icons/obj/bureaucracy.dmi

Adds toy codex gigas

Fixes compile errors, adds codex gigas sprite.

Lots of bug fixes.  Contracts work, devil revival is more consistant, etc

Adds missing icons for flaming contracts, summon pitchfork, summon wealth, employment cabinet, and sintouch.

Converts DEEP LORE explanations from hell to inferno incorporated.

Banishes the compile errors.

Devils come from hell again.

replaces offer drink obligation with a much more lore appropriate devil's fiddle reference
Also fixes contract bashing brain damage chance.

Undoes some changes I accidentally did to example config files.

Fixes up a few remaining bugs.

Puts in the codex gigas and employment contract cabinets.
 -- Lemon - I kinda skipped this one, I'll patch it back in later because
 map conflicts are suffering incarnate

Solves the devil law problem in a REALLY hacky snowflake way.

Fixes a few methods in which a hellbound can be revived.

Devils respawn with a limited number of appropriate items, instead of COMPLETELY naked upon corpse destruction.  Also adds lines to example config.

Updates devil laws to be less hacky.

Objective to sintouch x mortals now greentexts correctly.

Contracts no longer cause brain damage.  I didn't realize it was lethal on this codebase.  Oops.

Splits dust(visual_only) into dust() and dust_animation() procs

Fixes some defines.
Adds undef statements to improve compile times.

Fixes race changes from demonic form changes.

Fixes small runtime error. (Which somehow didn't break anything?)

Implements lots of small changes/corrections suggested by CrazyLemon64

I still need to test these changes, along with other potential issues he brought up.

Fixes harvest bane and power contracts.  Also adds a few </span> tag enders.

Corrects some edge cases with revival contracts.

Fixes compile error.

Reverts unneccecary change to item/weapon/reagent_containers

Cleans up the code for readability.

Prevents cloning of hellbound individuals.

Latejoins now properly have employment contracts added to employment cabinets (provided they still exist)

Infernal contracts are no longer rendered unreadable by fire and alcohol.

All fireproof paper remains readable after being fireballed, not just infernal contracts.  (Though infernal contracts are the only fireproof paper atm)

Fixes an edge case problem with cloning.

Adds is_revivable proc to mind.

Removes snowflake code involving preventing soulseller resurrection.

Indulges in the sin of sloth, and copies tg's lazy list macros

Proc calls that transform the user no longer go to a null target

Fixes devil UI, human regression will keep appearance, and adds danceoff

Devil's base forms no longer suffocate inside the devil

Fixes runtimes, gets stuff working

The arch devil can now blast down walls with their pitchfork

EXTERMINATE ALL SPIRITS

Activates devil clause in voice of god

Fawks Mcclood

Feature P A R I T Y

Fixes devil bugs from testing

- Does a death refactor to make sure that diabolical resurrection works

- Walls no longer leave girders when blasted by the devil

- Getting a new body gives you a rudimentary amount of equipment to work
with to get out of maintenance or whereever

Does all the icons in a single commit on their own because icon

conflicts suck

Starting point of extra devil rebalance/fixes

Ports devil friends

Also oops tramples all over Fethas' corpse PR that's still up I need
to take care of that one

Styling fixes
2019-01-13 12:00:49 +01:00

333 lines
10 KiB
Plaintext

/obj/item/projectile/magic
name = "bolt of nothing"
icon_state = "energy"
damage = 0
damage_type = OXY
nodamage = 1
armour_penetration = 100
flag = "magic"
/obj/item/projectile/magic/death
name = "bolt of death"
icon_state = "pulse1_bl"
/obj/item/projectile/magic/fireball
name = "bolt of fireball"
icon_state = "fireball"
damage = 10
damage_type = BRUTE
nodamage = 0
//explosion values
var/exp_devastate = -1
var/exp_heavy = 0
var/exp_light = 2
var/exp_flash = 3
var/exp_fire = 2
/obj/item/projectile/magic/death/on_hit(mob/living/carbon/C)
. = ..()
if(isliving(C))
if(ismachine(C)) //speshul snowfleks deserv speshul treetment
C.adjustFireLoss(6969) //remember - slimes love fire
else
C.death()
visible_message("<span class='danger'>[C] topples backwards as the death bolt impacts [C.p_them()]!</span>")
/obj/item/projectile/magic/fireball/Range()
var/turf/T1 = get_step(src,turn(dir, -45))
var/turf/T2 = get_step(src,turn(dir, 45))
var/turf/T3 = get_step(src,dir)
var/mob/living/L = locate(/mob/living) in T1 //if there's a mob alive in our front right diagonal, we hit it.
if(L && L.stat != DEAD)
Bump(L) //Magic Bullet #teachthecontroversy
return
L = locate(/mob/living) in T2
if(L && L.stat != DEAD)
Bump(L)
return
L = locate(/mob/living) in T3
if(L && L.stat != DEAD)
Bump(L)
return
..()
/obj/item/projectile/magic/fireball/on_hit(var/target)
. = ..()
var/turf/T = get_turf(target)
explosion(T, exp_devastate, exp_heavy, exp_light, exp_flash, 0, flame_range = exp_fire)
if(ismob(target)) //multiple flavors of pain
var/mob/living/M = target
M.take_overall_damage(0,10) //between this 10 burn, the 10 brute, the explosion brute, and the onfire burn, your at about 65 damage if you stop drop and roll immediately
/obj/item/projectile/magic/fireball/infernal
name = "infernal fireball"
exp_heavy = -1
exp_light = -1
exp_flash = 4
exp_fire= 5
/obj/item/projectile/magic/resurrection
name = "bolt of resurrection"
icon_state = "ion"
/obj/item/projectile/magic/resurrection/on_hit(var/mob/living/carbon/target)
. = ..()
if(ismob(target))
var/old_stat = target.stat
target.suiciding = 0
target.revive()
if(!target.ckey)
for(var/mob/dead/observer/ghost in GLOB.player_list)
if(target.real_name == ghost.real_name)
ghost.reenter_corpse()
break
if(old_stat != DEAD)
to_chat(target, "<span class='notice'>You feel great!</span>")
else
to_chat(target, "<span class='notice'>You rise with a start, you're alive!!!</span>")
/obj/item/projectile/magic/teleport
name = "bolt of teleportation"
icon_state = "bluespace"
var/inner_tele_radius = 0
var/outer_tele_radius = 6
/obj/item/projectile/magic/teleport/on_hit(var/mob/target)
. = ..()
var/teleammount = 0
var/teleloc = target
if(!isturf(target))
teleloc = target.loc
for(var/atom/movable/stuff in teleloc)
if(!stuff.anchored && stuff.loc)
teleammount++
do_teleport(stuff, stuff, 10)
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(max(round(10 - teleammount),1), 0, stuff.loc) //Smoke drops off if a lot of stuff is moved for the sake of sanity
smoke.start()
/obj/item/projectile/magic/door
name = "bolt of door creation"
icon_state = "energy"
var/list/door_types = list(/obj/structure/mineral_door/wood,/obj/structure/mineral_door/iron,/obj/structure/mineral_door/silver,\
/obj/structure/mineral_door/gold,/obj/structure/mineral_door/uranium,/obj/structure/mineral_door/sandstone,/obj/structure/mineral_door/transparent/plasma,\
/obj/structure/mineral_door/transparent/diamond)
/obj/item/projectile/magic/door/on_hit(var/atom/target)
. = ..()
var/atom/T = target.loc
if(isturf(target) && target.density)
CreateDoor(target)
else if(isturf(T) && T.density)
CreateDoor(T)
else if(istype(target, /obj/machinery/door))
OpenDoor(target)
/obj/item/projectile/magic/door/proc/CreateDoor(turf/T)
var/door_type = pick(door_types)
var/obj/structure/mineral_door/D = new door_type(T)
T.ChangeTurf(/turf/simulated/floor/plasteel)
D.Open()
/obj/item/projectile/magic/door/proc/OpenDoor(var/obj/machinery/door/D)
if(istype(D,/obj/machinery/door/airlock))
var/obj/machinery/door/airlock/A = D
A.locked = 0
D.open()
/obj/item/projectile/magic/change
name = "bolt of change"
icon_state = "ice_1"
damage_type = BURN
/obj/item/projectile/magic/change/on_hit(var/atom/change)
. = ..()
wabbajack(change)
/proc/wabbajack(mob/living/M)
if(istype(M) && M.stat != DEAD && !M.notransform)
M.notransform = TRUE
M.canmove = FALSE
M.icon = null
M.overlays.Cut()
M.invisibility = 101
if(isrobot(M))
var/mob/living/silicon/robot/Robot = M
QDEL_NULL(Robot.mmi)
Robot.notify_ai(1)
else
if(ishuman(M))
var/mob/living/carbon/human/H = M
// Make sure there are no organs or limbs to drop
for(var/t in H.bodyparts)
qdel(t)
for(var/i in H.internal_organs)
qdel(i)
for(var/obj/item/W in M)
M.unEquip(W, 1)
qdel(W)
var/mob/living/new_mob
var/randomize = pick("robot", "slime", "xeno", "human", "animal")
switch(randomize)
if("robot")
if(prob(30))
new_mob = new /mob/living/silicon/robot/syndicate(M.loc)
else
new_mob = new /mob/living/silicon/robot(M.loc)
new_mob.gender = M.gender
new_mob.invisibility = 0
new_mob.job = "Cyborg"
var/mob/living/silicon/robot/Robot = new_mob
Robot.mmi = new /obj/item/mmi(new_mob)
if(ishuman(M))
Robot.mmi.transfer_identity(M) //Does not transfer key/client.
if("slime")
new_mob = new /mob/living/carbon/slime/random(M.loc)
new_mob.universal_speak = TRUE
if("xeno")
if(prob(50))
new_mob = new /mob/living/carbon/alien/humanoid/hunter(M.loc)
else
new_mob = new /mob/living/carbon/alien/humanoid/sentinel(M.loc)
new_mob.universal_speak = TRUE
if("animal")
if(prob(50))
var/beast = pick("carp","bear","mushroom","statue", "bat", "goat", "tomato")
switch(beast)
if("carp")
new_mob = new /mob/living/simple_animal/hostile/carp(M.loc)
if("bear")
new_mob = new /mob/living/simple_animal/hostile/bear(M.loc)
if("mushroom")
new_mob = new /mob/living/simple_animal/hostile/mushroom(M.loc)
if("statue")
new_mob = new /mob/living/simple_animal/hostile/statue(M.loc)
if("bat")
new_mob = new /mob/living/simple_animal/hostile/scarybat(M.loc)
if("goat")
new_mob = new /mob/living/simple_animal/hostile/retaliate/goat(M.loc)
if("tomato")
new_mob = new /mob/living/simple_animal/hostile/killertomato(M.loc)
else
var/animal = pick("parrot", "corgi", "crab", "pug", "cat", "mouse", "chicken", "cow", "lizard", "chick", "fox")
switch(animal)
if("parrot")
new_mob = new /mob/living/simple_animal/parrot(M.loc)
if("corgi")
new_mob = new /mob/living/simple_animal/pet/corgi(M.loc)
if("crab")
new_mob = new /mob/living/simple_animal/crab(M.loc)
if("cat")
new_mob = new /mob/living/simple_animal/pet/cat(M.loc)
if("mouse")
new_mob = new /mob/living/simple_animal/mouse(M.loc)
if("chicken")
new_mob = new /mob/living/simple_animal/chicken(M.loc)
if("cow")
new_mob = new /mob/living/simple_animal/cow(M.loc)
if("lizard")
new_mob = new /mob/living/simple_animal/lizard(M.loc)
if("fox")
new_mob = new /mob/living/simple_animal/pet/fox(M.loc)
else
new_mob = new /mob/living/simple_animal/chick(M.loc)
new_mob.universal_speak = TRUE
if("human")
new_mob = new /mob/living/carbon/human(M.loc)
var/mob/living/carbon/human/H = new_mob
var/datum/preferences/A = new() //Randomize appearance for the human
A.species = get_random_species(TRUE)
A.copy_to(new_mob)
randomize = H.dna.species.name
else
return
M.create_attack_log("<font color='orange'>[key_name(M)] became [new_mob.real_name].</font>")
new_mob.attack_log = M.attack_log
new_mob.a_intent = INTENT_HARM
if(M.mind)
M.mind.transfer_to(new_mob)
else
new_mob.key = M.key
to_chat(new_mob, "<B>Your form morphs into that of a [randomize].</B>")
qdel(M)
return new_mob
/obj/item/projectile/magic/animate
name = "bolt of animation"
icon_state = "red_1"
damage_type = BURN
/obj/item/projectile/magic/animate/Bump(var/atom/change)
..()
if(istype(change, /obj/item) || istype(change, /obj/structure) && !is_type_in_list(change, protected_objects))
if(istype(change, /obj/structure/closet/statue))
for(var/mob/living/carbon/human/H in change.contents)
var/mob/living/simple_animal/hostile/statue/S = new /mob/living/simple_animal/hostile/statue(change.loc, firer)
S.name = "statue of [H.name]"
S.faction = list("\ref[firer]")
S.icon = change.icon
if(H.mind)
H.mind.transfer_to(S)
to_chat(S, "<span class='warning'>You are an animated statue. You cannot move when monitored, but are nearly invincible and deadly when unobserved!</span>")
to_chat(S, "<span class='userdanger'>Do not harm [firer.name], your creator.</span>")
H = change
H.loc = S
qdel(src)
else
var/obj/O = change
if(istype(O, /obj/item/gun))
new /mob/living/simple_animal/hostile/mimic/copy/ranged(O.loc, O, firer)
else
new /mob/living/simple_animal/hostile/mimic/copy(O.loc, O, firer)
else if(istype(change, /mob/living/simple_animal/hostile/mimic/copy))
// Change our allegiance!
var/mob/living/simple_animal/hostile/mimic/copy/C = change
C.ChangeOwner(firer)
/obj/item/projectile/magic/spellblade
name = "blade energy"
icon_state = "lavastaff"
damage = 15
damage_type = BURN
flag = "magic"
dismemberment = 50
nodamage = 0
/obj/item/projectile/magic/slipping
name = "magical banana"
icon = 'icons/obj/hydroponics/harvest.dmi'
icon_state = "banana"
var/slip_stun = 5
var/slip_weaken = 5
hitsound = 'sound/items/bikehorn.ogg'
/obj/item/projectile/magic/slipping/New()
..()
SpinAnimation()
/obj/item/projectile/magic/slipping/on_hit(var/atom/target, var/blocked = 0)
if(ishuman(target))
var/mob/living/carbon/human/H = target
H.slip(src, slip_stun, slip_weaken, 0, FALSE, TRUE) //Slips even with noslips/magboots on. NO ESCAPE!
else if(isrobot(target)) //You think you're safe, cyborg? FOOL!
var/mob/living/silicon/robot/R = target
if(!R.incapacitated())
to_chat(target, "<span class='warning'>You get splatted by [src], HONKING your sensors!</span>")
R.Stun(slip_stun)
else if(ismob(target))
var/mob/M = target
if(!M.stunned)
to_chat(target, "<span class='notice'>You get splatted by [src].</span>")
M.Weaken(slip_weaken)
M.Stun(slip_stun)
. = ..()