Merge pull request #8927 from Xhuis/shadowlingUpdateOne

Shadowling Update I
This commit is contained in:
phil235
2015-04-14 21:22:46 +02:00
12 changed files with 125 additions and 36 deletions
+2 -1
View File
@@ -24,4 +24,5 @@
#define ANTAG_HUD_OPS 7
#define ANTAG_HUD_GANG_A 8
#define ANTAG_HUD_GANG_B 9
#define ANTAG_HUD_WIZ 10
#define ANTAG_HUD_WIZ 10
#define ANTAG_HUD_SHADOW 11
+1
View File
@@ -12,6 +12,7 @@ var/datum/atom_hud/huds = list( \
ANTAG_HUD_GANG_A = new/datum/atom_hud/antag(), \
ANTAG_HUD_GANG_B = new/datum/atom_hud/antag(), \
ANTAG_HUD_WIZ = new/datum/atom_hud/antag(), \
ANTAG_HUD_SHADOW = new/datum/atom_hud/antag(), \
)
/datum/atom_hud
+3 -4
View File
@@ -1058,6 +1058,7 @@
else if(href_list["shadowling"])
switch(href_list["shadowling"])
if("clear")
ticker.mode.update_shadow_icons_removed(src)
src.spell_list = null
if(src in ticker.mode.shadows)
ticker.mode.shadows -= src
@@ -1083,9 +1084,8 @@
current << "<span class='deadsay'><b>You notice a brightening around you. No, it isn't that. The shadows grow, darken, swirl. The darkness has a new welcome for you, and you realize with a \
start that you can't be human. No, you are a shadowling, a harbringer of the shadows! Your alien abilities have been unlocked from within, and you may both commune with your allies and use \
a chrysalis to reveal your true form. You are to ascend at all costs.</b></span>"
src.spell_list += new /obj/effect/proc_holder/spell/targeted/shadowling_hivemind
src.spell_list += new /obj/effect/proc_holder/spell/targeted/enthrall
current.verbs += /mob/living/carbon/human/proc/shadowling_hatch
ticker.mode.finalize_shadowling(src)
ticker.mode.update_shadow_icons_added(src)
if("thrall")
if(!ishuman(current))
usr << "<span class='warning'>This only works on humans!</span>"
@@ -1097,7 +1097,6 @@
current << "<span class='danger'>You may use the Hivemind Commune ability to communicate with your fellow enlightened ones.</span>"
message_admins("[key_name_admin(usr)] has thrall'ed [current].")
log_admin("[key_name(usr)] has thrall'ed [current].")
src.spell_list += new /obj/effect/proc_holder/spell/targeted/shadowling_hivemind
else if (href_list["monkey"])
var/mob/living/L = current
+41 -17
View File
@@ -1,3 +1,7 @@
#define LIGHT_DAM_THRESHOLD 4
#define LIGHT_HEAL_THRESHOLD 2
#define LIGHT_DAMAGE_TAKEN 10
/*
SHADOWLING: A gamemode based on previously-run events
@@ -72,7 +76,7 @@ Made by Xhuis
/datum/game_mode/shadowling/announce()
world << "<b>The current game mode is - Shadowling!</b>"
world << "<b>There are alien <span class='userdanger'>shadowlings</span> on the station. Crew: Kill the shadowlings before they can eat or enthrall the crew. Shadowlings: Enthrall the crew while remaining in hiding.</b>"
world << "<b>There are alien <span class='deadsay'>shadowlings</span> on the station. Crew: Kill the shadowlings before they can eat or enthrall the crew. Shadowlings: Enthrall the crew while remaining in hiding.</b>"
/datum/game_mode/shadowling/pre_setup()
if(config.protect_roles_from_antagonist)
@@ -114,6 +118,7 @@ Made by Xhuis
/datum/game_mode/proc/greet_shadow(var/datum/mind/shadow)
shadow.current << "<b>Currently, you are disguised as an employee aboard [world.name].</b>"
shadow.current << "<b>In your limited state, you have three abilities: Enthrall, Hatch, and Hivemind Commune.</b>"
shadow.current << "<b>Any other shadowlings are you allies. You must assist them as they shall assist you.</b>"
shadow.current << "<b>If you are new to shadowling, or want to read about abilities, check the wiki page at https://tgstation13.org/wiki/Shadowling</b><br>"
@@ -131,17 +136,25 @@ Made by Xhuis
var/mob/living/carbon/human/S = shadow_mind.current
shadow_mind.current.verbs += /mob/living/carbon/human/proc/shadowling_hatch
shadow_mind.spell_list += new /obj/effect/proc_holder/spell/targeted/enthrall
shadow_mind.spell_list += new /obj/effect/proc_holder/spell/targeted/shadowling_hivemind
if(shadow_mind.assigned_role == "Clown")
S << "<span class='notice'>Your alien nature has allowed you to overcome your clownishness.</span>"
S.dna.remove_mutation(CLOWNMUT)
spawn(0)
shadow_mind.spell_list += new /obj/effect/proc_holder/spell/targeted/shadowling_hivemind
update_shadow_icons_added(shadow_mind)
if(shadow_mind.assigned_role == "Clown")
S << "<span class='notice'>Your alien nature has allowed you to overcome your clownishness.</span>"
S.dna.remove_mutation(CLOWNMUT)
/datum/game_mode/proc/add_thrall(datum/mind/new_thrall_mind)
if (!istype(new_thrall_mind))
return 0
if(!(new_thrall_mind in thralls))
update_shadow_icons_added(new_thrall_mind)
thralls += new_thrall_mind
new_thrall_mind.current.attack_log += "\[[time_stamp()]\] <span class='danger'>Became a thrall</span>"
new_thrall_mind.memory += "<b>The Shadowlings' Objectives:</b> Ascend to your true form by use of the Ascendance ability. \
This may only be used with [required_thralls] collective thralls, while hatched, and is unlocked with the Collective Mind ability."
new_thrall_mind.current << "<b>The objectives of your shadowlings:</b>: Ascend to your true form by use of the Ascendance ability. \
This may only be used with [required_thralls] collective thralls, while hatched, and is unlocked with the Collective Mind ability."
new_thrall_mind.spell_list += new /obj/effect/proc_holder/spell/targeted/shadowling_hivemind
return 1
@@ -175,11 +188,11 @@ Made by Xhuis
/datum/game_mode/shadowling/declare_completion()
if(check_shadow_victory() && SSshuttle.emergency.mode >= SHUTTLE_ESCAPE) //Doesn't end instantly - this is hacky and I don't know of a better way ~X
world << "<font size=3 color=green><b>The shadowlings have ascended and taken over the station!</FONT></b></span>"
world << "<span class='greentext'><b>The shadowlings have ascended and taken over the station!</b></span>"
else if(shadowling_dead && !check_shadow_victory()) //If the shadowlings have ascended, they can not lose the round
world << "<span class='danger'><font size=3><b>The shadowlings have been killed by the crew!</b></FONT></span>"
world << "<span class='redtext'><b>The shadowlings have been killed by the crew!</b></span>"
else if(!check_shadow_victory() && SSshuttle.emergency.mode >= SHUTTLE_ESCAPE)
world << "<span class='danger'><font size=3><b>The crew has escaped the station before the shadowlings could ascend!</b></FONT></span>"
world << "<span class='redtext'><b>The crew has escaped the station before the shadowlings could ascend!</b></span>"
..()
return 1
@@ -187,15 +200,14 @@ Made by Xhuis
/datum/game_mode/proc/auto_declare_completion_shadowling()
var/text = ""
if(shadows.len)
text += "<br><font size=2><b>The shadowlings were:</b></font>"
text += "<br><span class='big'><b>The shadowlings were:</b></span>"
for(var/datum/mind/shadow in shadows)
text += printplayer(shadow)
text += "<br>"
if(thralls.len)
text += "<br><font size=2><b>The thralls were:</b></font>"
text += "<br><span class='big'><b>The thralls were:</b></span>"
for(var/datum/mind/thrall in thralls)
text += printplayer(thrall)
else
world << "<font size=3>Round-end code broke! Please report this and its circumstances on GitHub at https://github.com/tgstation/-tg-station/issues</font>"
text += "<br>"
world << text
@@ -224,12 +236,24 @@ Made by Xhuis
if(A)
if(A.lighting_use_dynamic) light_amount = T.lighting_lumcount
else light_amount = 10
if(light_amount > 2) //Rapid death while in the light, countered by...
H.take_overall_damage(0,6)
if(light_amount > LIGHT_DAM_THRESHOLD) //Not complete blackness - they can live in very small light levels plus starlight
H.take_overall_damage(0, LIGHT_DAMAGE_TAKEN)
H << "<span class='userdanger'>The light burns you!</span>"
H << 'sound/weapons/sear.ogg'
else if (light_amount < 2) //...extreme benefits while in the dark
H.heal_overall_damage(5,3)
H.adjustToxLoss(-3)
else if (light_amount < LIGHT_HEAL_THRESHOLD)
H.heal_overall_damage(5,5)
H.adjustToxLoss(-5)
H.adjustBrainLoss(-25) //gibbering shadowlings are hilarious but also bad to have
H.adjustCloneLoss(-1)
H.SetWeakened(0)
H.SetStunned(0)
/datum/game_mode/proc/update_shadow_icons_added(datum/mind/shadow_mind)
var/datum/atom_hud/antag/shadow_hud = huds[ANTAG_HUD_SHADOW]
shadow_hud.join_hud(shadow_mind.current)
set_antag_hud(shadow_mind.current, ((shadow_mind in shadows) ? "shadowling" : "thrall"))
/datum/game_mode/proc/update_shadow_icons_removed(datum/mind/shadow_mind) //This should never actually occur, but it's here anyway.
var/datum/atom_hud/antag/shadow_hud = huds[ANTAG_HUD_SHADOW]
shadow_hud.leave_hud(shadow_mind.current)
set_antag_hud(shadow_mind.current, null)
@@ -21,7 +21,7 @@
usr.visible_message("<span class='warning'><b>[usr]'s eyes flash a blinding red!</b></span>")
target.visible_message("<span class='danger'>[target] freezes in place, their eyes glazing over...</span>")
if(in_range(target, usr))
target << "<span class='userdanger'>Your gaze is forcibly drawn into [src]'s eyes, and you are mesmerized by the heavenly lights...</span>"
target << "<span class='userdanger'>Your gaze is forcibly drawn into [usr]'s eyes, and you are mesmerized by the heavenly lights...</span>"
else //Only alludes to the shadowling if the target is close by
target << "<span class='userdanger'>Red lights suddenly dance in your vision, and you are mesmerized by the heavenly lights...</span>"
target.Stun(10)
@@ -53,9 +53,26 @@
L.on = 0
L.visible_message("<span class='danger'>[L] flickers and falls dark.</span>")
L.update(0)
for(var/obj/item/device/pda/P in orange(5, usr))
for(var/obj/item/device/pda/P in T.contents)
P.fon = 0
P.SetLuminosity(0) //failsafe
P.SetLuminosity(0)
for(var/obj/effect/glowshroom/G in orange(2, usr)) //Very small radius
G.visible_message("<span class='warning'>\The [G] withers away!</span>")
qdel(G)
for(var/mob/living/carbon/human/H in T.contents)
for(var/obj/item/device/flashlight/F in H)
if(is_type_in_list(F, blacklisted_lights))
F.visible_message("<span class='danger'>[F] goes slightly dim for a moment.</span>")
return
F.on = 0
F.visible_message("<span class='danger'>[F] gutters and falls dark.</span>")
F.update_brightness()
for(var/obj/item/device/pda/P in H)
P.fon = 0
P.SetLuminosity(0) //failsafe
if(H != usr)
H << "<span class='boldannounce'>You feel a chill and are plunged into darkness.</span>"
H.luminosity = 0 //This is required with the object-based lighting
@@ -164,11 +181,23 @@
usr.visible_message("<span class='danger'>[usr] leans over [target], their eyes glowing a deep crimson, and stares into their face.</span>")
target << "<span class='danger'>Your gaze is forcibly drawn into a blinding red light. You fall to the floor as conscious thought is wiped away.</span>"
target.Weaken(12)
sleep(20)
if(isloyal(target))
usr << "<span class='notice'>They are enslaved by Nanotrasen. You begin to shut down the nanobot implant - this will take some time.</span>"
usr.visible_message("<span class='danger'>[usr] halts for a moment, then begins passing its hand over [target]'s body.</span>")
target << "<span class='danger'>You feel your loyalties begin to weaken!</span>"
sleep(150) //15 seconds - not spawn() so the enthralling takes longer
usr << "<span class='notice'>The nanobots composing the loyalty implant have been rendered inert. Now to continue.</span>"
usr.visible_message("<span class='danger'>[usr] halts thier hand and resumes staring into [target]'s face.</span>")
for(var/obj/item/weapon/implant/loyalty/L in target)
if(L && L.implanted)
qdel(L)
target << "<span class='danger'>Your unwavering loyalty to Nanotrasen falters, dims, dies.</span>"
if(3)
usr << "<span class='notice'>You begin rearranging [target]'s memories.</span>"
usr.visible_message("<span class='danger'>[usr]'s eyes flare brightly, and a horrible grin begins to spread across [target]'s face...</span>")
target << "<span class='danger'>Your head cries out. The veil of reality begins to crumple and something evil bleeds through.</span>" //Ow the edge
if(!do_mob(usr, target, 100)) //around 30 seconds total for enthralling
if(!do_mob(usr, target, 100)) //around 30 seconds total for enthralling, 45 for someone with a loyalty implant
usr << "<span class='danger'>The enthralling has been interrupted - your target's mind returns to its previous state.</span>"
target << "<span class='warning'>Your thoughts become coherent once more. Already you can barely remember what's happened to you.</span>"
enthralling = 0
@@ -183,8 +212,6 @@
target.adjustOxyLoss(-200) //In case the shadowling was choking them out
ticker.mode.add_thrall(target.mind)
target.mind.special_role = "Thrall"
var/datum/mind/thrall_mind = target.mind
thrall_mind.spell_list += new /obj/effect/proc_holder/spell/targeted/shadowling_hivemind //Lets thralls hive-chat
@@ -208,6 +235,30 @@
/obj/effect/proc_holder/spell/targeted/shadowling_regenarmor
name = "Regenerate Chitin"
desc = "Re-forms protective chitin that may be lost during cloning or similar processes."
panel = "Shadowling Abilities"
charge_max = 600
clothes_req = 0
range = -1
include_user = 1
/obj/effect/proc_holder/spell/targeted/shadowling_regenarmor/cast(list/targets)
for(var/mob/living/user in targets)
user.visible_message("<span class='warning'>[user]'s skin suddenly bubbles and begins to shift around their body!</span>", \
"<span class='shadowling'>You regenerate your protective armor and cleanse your form of defects.</span>")
user.equip_to_slot_or_del(new /obj/item/clothing/under/shadowling(usr), slot_w_uniform)
user.equip_to_slot_or_del(new /obj/item/clothing/shoes/shadowling(usr), slot_shoes)
user.equip_to_slot_or_del(new /obj/item/clothing/suit/space/shadowling(usr), slot_wear_suit)
user.equip_to_slot_or_del(new /obj/item/clothing/head/shadowling(usr), slot_head)
user.equip_to_slot_or_del(new /obj/item/clothing/gloves/shadowling(usr), slot_gloves)
user.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/shadowling(usr), slot_wear_mask)
user.equip_to_slot_or_del(new /obj/item/clothing/glasses/night/shadowling(usr), slot_glasses)
hardset_dna(user, null, null, null, null, /datum/species/shadow/ling) //can't be a shadowling without being a shadowling
/obj/effect/proc_holder/spell/targeted/collective_mind
name = "Collective Hivemind"
desc = "Gathers the power of all of your thralls and compares it to what is needed for ascendance. Also gains you new abilities."
@@ -254,7 +305,7 @@
user << "<span class='shadowling'><i>The power of your thralls has granted you the <b>Sonic Screech</b> ability. This ability will shatter nearby windows and deafen enemies.</span>"
user.mind.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/unearthly_screech
if(thralls >= 10 && !thrall_swap_acquired)
if(thralls >= 9 && !thrall_swap_acquired)
thrall_swap_acquired = 1
user << "<span class='shadowling'><i>The power of your thralls has granted you the <b>Spatial Relocation</b> ability. This will, allow you to instantly swap places with one of your thralls in \
addition to shattering nearby lights.</i></span>"
@@ -351,7 +402,6 @@ datum/reagent/shadowling_blindness_smoke/on_mob_life(var/mob/living/M as mob)
if(iscarbon(target))
var/mob/living/carbon/M = target
M << "<span class='danger'><b>A spike of pain drives into your head and scrambles your thoughts!</b></span>"
M.Weaken(2)
M.confused += 10
M.setEarDamage(M.ear_damage + 3)
else if(issilicon(target))
@@ -364,7 +414,7 @@ datum/reagent/shadowling_blindness_smoke/on_mob_life(var/mob/living/M as mob)
sp.start()
S.Weaken(6)
for(var/obj/structure/window/W in T.contents)
W.hit(rand(25,50))
W.hit(rand(50,100))
@@ -448,7 +498,7 @@ datum/reagent/shadowling_blindness_smoke/on_mob_life(var/mob/living/M as mob)
charge_counter = charge_max
return
for(var/mob/boom in targets)
for(var/mob/living/carbon/human/boom in targets)
if(is_shadow_or_thrall(boom))
usr << "<span class='warning'>Making an ally explode seems unwise.<span>"
charge_counter = charge_max
@@ -46,7 +46,7 @@
/obj/item/clothing/gloves/shadowling
name = "chitin hands"
desc = "An electricity-resistant yet thin covering of the hands."
desc = "An electricity-resistant covering of the hands."
icon_state = "golem"
item_state = null
origin_tech = null
@@ -75,10 +75,11 @@
vision_flags = SEE_MOBS
darkness_view = 3
invis_view = 2
flash_protect = 2
flash_protect = -1
unacidable = 1
flags = ABSTRACT | NODROP
/obj/structure/shadow_vortex
name = "vortex"
desc = "A swirling hole in the fabric of reality. Eye-watering chimes sound from its depths."
@@ -85,6 +85,7 @@
usr.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/shadow_walk
usr.mind.spell_list += new /obj/effect/proc_holder/spell/aoe_turf/flashfreeze
usr.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/collective_mind
usr.mind.spell_list += new /obj/effect/proc_holder/spell/targeted/shadowling_regenarmor
@@ -158,4 +159,5 @@
sleep(50)
if(!ticker.mode.shadowling_ascended)
SSshuttle.emergency.request(null, 0.3)
ticker.mode.shadowling_ascended = 1
qdel(usr)
@@ -173,7 +173,7 @@
/obj/item/weapon/implant/loyalty/implanted(mob/target)
..()
if((target.mind in ticker.mode.head_revolutionaries) || (target.mind in ticker.mode.A_bosses) || (target.mind in ticker.mode.B_bosses))
if((target.mind in ticker.mode.head_revolutionaries) || (target.mind in ticker.mode.A_bosses) || (target.mind in ticker.mode.B_bosses) || is_shadow_or_thrall(target))
target.visible_message("<span class='warning'>[target] seems to resist the implant!</span>", "<span class='warning'>You feel the corporate tendrils of Nanotrasen try to invade your mind!</span>")
return 0
if((target.mind in ticker.mode.revolutionaries) || (target.mind in ticker.mode.A_gangsters) || (target.mind in ticker.mode.B_gangsters))
@@ -684,7 +684,8 @@ proc/chemical_mob_spawn(var/datum/reagents/holder, var/amount_to_spawn, var/reac
/mob/living/simple_animal/hostile/carp/holocarp,
/mob/living/simple_animal/hostile/mining_drone,
/mob/living/simple_animal/hostile/poison,
/mob/living/simple_animal/hostile/blob
/mob/living/simple_animal/hostile/blob,
/mob/living/simple_animal/ascendant_shadowling
)//exclusion list for things you don't want the reaction to create.
var/list/critters = typesof(/mob/living/simple_animal/hostile) - blocked // list of possible hostile mobs
var/atom/A = holder.my_atom