A bit more work

This commit is contained in:
Xhuis
2015-06-18 00:02:16 -04:00
parent e206641698
commit dd2e262344
4 changed files with 160 additions and 78 deletions
@@ -8,7 +8,7 @@
desc = "A malevolent spirit."
icon = 'icons/mob/mob.dmi'
icon_state = "revenant_idle"
incorporeal_move = 1
incorporeal_move = 3
invisibility = INVISIBILITY_OBSERVER
health = 25
maxHealth = 25
@@ -35,6 +35,17 @@
var/revealed = 0 //If the revenant can take damage from normal sources.
var/inhibited = 0 //If the revenant's abilities are blocked by a chaplain's power.
/mob/living/simple_animal/revenant/relaymove(var/mob/user, direction)
var/turf/newLoc = get_step(src,direction)
world << "memes"
if((newLoc.flags & NOJAUNT))
world << "they're dank"
user << "<span class='warning'>A holy aura pervades this area.</span>"
notransform = 0
spawn(2)
notransform = 1
return 0
/mob/living/simple_animal/revenant/Life()
..()
if(essence < essence_min)
@@ -50,9 +61,6 @@
if(essence_regen && !inhibited && essence < essence_regen_cap) //While inhibited, essence will not regenerate
essence++
/mob/living/simple_animal/revenant/Process_Spacemove(var/movement_dir = 0)
return 1 //Mainly to prevent the no-grav effect
/mob/living/simple_animal/revenant/ex_act(severity, target)
return 1 //Immune to the effects of explosions.
@@ -91,16 +99,26 @@
..()
spawn(5)
if(src.mind)
src.mind.remove_all_antag()
src.mind.wipe_memory()
src << 'sound/effects/ghost.ogg'
src.store_memory("<span class='deadsay'>I am a revenant. My spectral form has been empowered. My only goal is to gather essence from the humans of [world.name].</span>")
src << "<br>"
src << "<span class='deadsay'><font size=3><b>You are a revenant.</b></font></span>"
src << "<b>Your formerly mundane spirit has been infused with alien energies and empowered into a revenant.</b>"
src << "<b>You are not dead, not alive, but somewhere in between. You are capable of limited interaction with both worlds.</b>"
src << "<b>You are invincible and invisible to everyone but other ghosts. Some abilities may change this.</b>"
src << "<b>You are an animancer - to function, you are to drain the life essence from humans. This essence is a resource and will power all of your abilities.</b>"
src << "<b>To function, you are to drain the life essence from humans. This essence is a resource and will power all of your abilities.</b>"
src << "<b><i>You do not remember anything of your past lives, nor will you remember anything about this one after your death.</i></b>"
src << "<b>Be sure to read the wiki page at https://tgstation13.org/wiki/Revenant to learn more.</b>"
src << "<br>"
var/datum/objective/revenant/objective = new
objective.owner = src
src.mind.objectives += objective
src << "<b>Objective #1</b>: [objective.explanation_text]"
var/datum/objective/revenantFluff/objective2 = new
objective2.owner = src
src.mind.objectives += objective2
src << "<b>Objective #2</b>: [objective2.explanation_text]"
ticker.mode.traitors |= src.mind //Necessary for announcing
if(!src.giveSpells())
message_admins("Revenant was created but has no mind. Trying again in five seconds.")
spawn(50)
@@ -113,11 +131,12 @@
src.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/revenant_harvest
src.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/revenant_transmit
src.mind.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/revenant_light
src.mind.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/revenantDefile
return 1
return 0
/mob/living/simple_animal/revenant/death()
if(!strikes)
if(strikes)
return 0 //Impossible to die with strikes still active
..(1)
src << "<span class='userdanger'><b>NO! No... it's too late, you can feel yourself fading...</b></span>"
@@ -127,7 +146,7 @@
playsound(src, 'sound/effects/screech.ogg', 100, 1)
visible_message("<span class='warning'>[src] lets out a waning screech as violet mist swirls around its dissolving body!</span>")
icon_state = "revenant_draining"
for(var/i = alpha, i > 0, i--)
for(var/i = alpha, i > 0, i -= 10)
sleep(0.1)
alpha = i
visible_message("<span class='danger'>[src]'s body breaks apart into blue dust.</span>")
@@ -148,34 +167,30 @@
/mob/living/simple_animal/revenant/attackby(obj/item/W, mob/living/user, params)
..()
if(istype(W, /obj/item/weapon/nullrod))
src.visible_message("<b>The revenant</b> screeches and flails!", \
"<span class='boldannounce'>The null rod invokes agony in you! You feel your essence draining away!</span>")
src.essence -= 25 //hella effective
src.inhibited = 1
visible_message("<span class='warning'>[src] violently flinches!</span>", \
"<span class='boldannounce'>The null rod invokes agony in you! You feel your essence draining away!</span>")
essence -= 25 //hella effective
inhibited = 1
spawn(30)
src.inhibited = 0
inhibited = 0
/obj/effect/proc_holder/spell/proc/essence_check(var/essence_cost, var/silent = 0)
var/mob/living/simple_animal/revenant/W = usr
if(!istype(usr) || !usr)
/mob/living/simple_animal/revenant/proc/castcheck(var/essence_cost)
var/mob/living/simple_animal/revenant/user = usr
if(!istype(user) || !user)
return
if(W.essence < essence_cost)
if(!silent)
W << "<span class='warning'>You need [essence_cost]E to use [name] but you only have [W.essence]E available. Harvest some more things.</span>"
return 0
W.essence -= essence_cost
return 1
/mob/living/simple_animal/revenant/proc/wallcheck()
var/turf/T = get_turf(usr)
if(!istype(T, /turf/simulated/wall))
return 1
usr << "<span class='warning'>[T] is solid and is blocking your abilities' effects.</span>"
return 0
if(istype(T, /turf/simulated/wall))
user << "<span class='warning'>You cannot use abilities from inside of a wall.</span>"
return 0
if(!user.change_essence_amount(essence_cost, 1))
user << "<span class='warning'>You lack the essence to use that ability.</span>"
return 0
if(user.inhibited)
user << "<span class='warning'>Your powers have been suppressed by holy energies!</span>"
return 0
return 1
@@ -183,14 +198,15 @@
var/mob/living/simple_animal/revenant/user = usr
if(!istype(usr) || !usr)
return
if(!essence_amt)
if(user.essence + essence_amt <= 0)
return
user.essence += essence_amt
user.essence = Clamp(user.essence, 0, INFINITY)
if(!silent)
if(essence_amt >= 0)
user << "<span class='info'>Gained [essence_amt]E from [source].</span>"
if(essence_amt > 0)
user << "<span class='notice'>Gained [essence_amt]E from [source].</span>"
else
user << "<span class='info'>Lost [essence_amt]E from [source].</span>"
user << "<span class='danger'>Lost [essence_amt]E from [source].</span>"
return 1
@@ -208,3 +224,39 @@
R.invisibility = INVISIBILITY_OBSERVER
if(stun)
R.notransform = 0
/datum/objective/revenant
dangerrating = 10
var/targetAmount = 100
/datum/objective/revenant/New()
targetAmount = rand(100,200)
explanation_text = "Absorb [targetAmount] points of essence."
..()
/datum/objective/revenant/check_completion()
if(!istype(owner.current, /mob/living/simple_animal/revenant) || !owner.current)
return 0
var/mob/living/simple_animal/revenant/R = owner.current
if(!R || R.stat == DEAD)
return 0
var/essenceAccumulated = R.essence
if(essenceAccumulated < targetAmount)
return 0
return 1
/datum/objective/revenantFluff
dangerrating = 0
/datum/objective/revenantFluff/New()
var/list/explanationTexts = list("Attempt to make your presence unknown to the crew.", \
"Collaborate with existing antagonists aboard the station to gain essence.", \
"Remain nonlethal and only absorb bodies that have already died.", \
"Use your environments to eliminate isolated people.", \
"If there is a chaplain aboard the station, ensure they are killed.", \
"Hinder the crew without killing them.")
explanation_text = pick(explanationTexts)
..()
/datum/objective/revenantFluff/check_completion()
return 1
@@ -11,11 +11,7 @@
var/list/drained_mobs = list() //Cannot harvest the same mob twice
/obj/effect/proc_holder/spell/targeted/revenant_harvest/cast(list/targets, var/mob/living/simple_animal/revenant/user = usr)
if(user.inhibited)
user << "<span class='warning'>Something is blocking the use of [src]!</span>"
charge_counter = charge_max
return
if(!user.wallcheck())
if(!user.castcheck(0))
charge_counter = charge_max
return
for(var/mob/living/carbon/human/target in targets)
@@ -87,11 +83,10 @@
var/locked = 1
/obj/effect/proc_holder/spell/targeted/revenant_transmit/cast(list/targets, var/mob/living/simple_animal/revenant/user = usr)
if(user.inhibited)
user << "<span class='warning'>Something is blocking the use of [src]!</span>"
if(!user.castcheck(-5))
charge_counter = charge_max
return
if(locked && essence_check(5, 1))
if(locked)
usr << "<span class='info'>You have unlocked Transmit!</span>"
locked = 0
charge_counter = charge_max
@@ -99,15 +94,6 @@
range = 7
include_user = 0
return
if(locked)
charge_counter = charge_max
return
if(!user.wallcheck())
charge_counter = charge_max
return
if(!essence_check(5))
charge_counter = charge_max
return
for(var/mob/living/M in targets)
spawn(0)
var/msg = stripped_input(usr, "What do you wish to tell [M]?", null, "")
@@ -129,25 +115,14 @@
var/locked = 1
/obj/effect/proc_holder/spell/aoe_turf/revenant_light/cast(list/targets, var/mob/living/simple_animal/revenant/user = usr)
if(user.inhibited)
user << "<span class='warning'>Something is blocking the use of [src]!</span>"
charge_counter = charge_max
return
if(locked && essence_check(25, 1))
user << "<span class='info'>You have unlocked Overload Light!</span>"
name = "Overload Light (25E)"
panel = "Revenant Abilities"
locked = 0
range = 5
if(!user.castcheck(-25))
charge_counter = charge_max
return
if(locked)
charge_counter = charge_max
return
if(!user.wallcheck())
charge_counter = charge_max
return
if(!essence_check(25))
user << "<span class='info'>You have unlocked Overload Light!</span>"
panel = "Revenant Abilities"
locked = 0
range = 5
charge_counter = charge_max
return
for(var/turf/T in targets)
@@ -165,3 +140,44 @@
M.electrocute_act(25, "[L.name]")
playsound(M, 'sound/machines/defib_zap.ogg', 50, 1, -1)
user.reveal(50, 1)
//Defile: Corrupts nearby stuff, unblesses floor tiles.
/obj/effect/proc_holder/spell/aoe_turf/revenantDefile
name = "Defile (30E)"
desc = "Twists and corrupts certain nearby objects."
panel = "Revenant Abilities (Locked)"
charge_max = 300
clothes_req = 0
range = 1
var/locked = 1
/obj/effect/proc_holder/spell/aoe_turf/revenantDefile/cast(list/targets, var/mob/living/simple_animal/revenant/user = usr)
if(!user.castcheck(-30))
charge_counter = charge_max
return
if(locked)
user << "<span class='info'>You have unlocked Defile!</span>"
panel = "Revenant Abilities"
locked = 0
range = 4
charge_counter = charge_max
return
for(var/turf/T in targets)
spawn(0)
if(T.flags & NOJAUNT)
T.flags -= NOJAUNT
for(var/obj/machinery/bot/bot in T.contents)
bot.emag_act()
bot.visible_message("<span class='warning'>[bot] [pick("shudders", "buzzes", "clunks")] [pick("oddly", "strangely", "loudly")]!</span>")
for(var/mob/living/carbon/human/human in T.contents)
human << "<span class='warning'>You suddenly feel tired.</span>"
human.adjustStaminaLoss(25)
for(var/mob/living/silicon/robot/robot in T.contents)
robot.visible_message("<span class='warning'>[robot] lets out an alarm!</span>", \
"<span class='boldannounce'>01001111 01010110 01000101 01010010 01001100 01001111 01000001 01000100</span>")
robot << 'sound/misc/interference.ogg'
playsound(robot, 'sound/machines/warning-buzzer.ogg', 50, 1)
for(var/obj/structure/window/window in T.contents)
window.hit(rand(10,50))
user.reveal(30, 1)
@@ -1,3 +1,5 @@
#define REVENANT_SPAWN_THRESHOLD 20
/datum/round_event_control/revenant
name = "Spawn Revenant"
typepath = /datum/round_event/revenant
@@ -6,13 +8,17 @@
earliest_start = 0 //Meant to mix things up early-game.
/datum/round_event/revenant
var/key_of_revenant
/datum/round_event/revenant/proc/get_revenant(var/end_if_fail = 0)
var/deadMobs = 0
for(var/mob/M in dead_mob_list)
deadMobs++
if(deadMobs < REVENANT_SPAWN_THRESHOLD)
message_admins("Random event attempted to spawn a revenant, but there were only [deadMobs]/[REVENANT_SPAWN_THRESHOLD] dead mobs.")
return
key_of_revenant = null
if(!key_of_revenant)
var/list/candidates = get_candidates(BE_REVENANT)
@@ -41,23 +47,21 @@
player_mind.assigned_role = "revenant"
player_mind.special_role = "Revenant"
ticker.mode.traitors |= player_mind
message_admins("[key_of_revenant] has been made into a Revenant by an event.")
log_game("[key_of_revenant] was spawned as a Revenant by an event.")
message_admins("[key_of_revenant] has been made into a revenant by an event.")
log_game("[key_of_revenant] was spawned as a revenant by an event.")
return 1
/datum/round_event/revenant/start()
get_revenant()
/datum/round_event/revenant/proc/find_revenant()
message_admins("Attempted to spawn a Revenant but there was no players available. Will try again momentarily, bear with me...")
message_admins("An event failed to spawn a revenant. Retrying momentarily...")
spawn(50)
if(get_revenant(1))
message_admins("Hooray! Situation has been resolved, [key_of_revenant] has been spawned as a Revenant.")
log_game("[key_of_revenant] was spawned as a Revenant by an event.")
message_admins("[key_of_revenant] has been spawned as a revenant.")
log_game("[key_of_revenant] was spawned as a revenant by an event.")
return 0
message_admins("Unfortunately, no candidates were available for becoming a Revenant. Shutting down. :(")
message_admins("No candidates were available for becoming a revenant.")
return kill()
+10
View File
@@ -297,6 +297,16 @@
anim(mobloc,mob,'icons/mob/mob.dmi',,"shadow",,L.dir)
L.loc = get_step(L, direct)
L.dir = direct
if(3) //Incorporeal move, but blocked by holy-watered tiles
var/turf/simulated/floor/stepTurf = get_step(L, direct)
if(stepTurf.flags & NODROP)
L << "<span class='warning'>Holy energies block your path.</span>"
L.notransform = 1
spawn(2)
L.notransform = 0
else
L.loc = get_step(L, direct)
L.dir = direct
return 1