Adds custom artifact creation. Adds the dead harvest artifact effect (#13751)

* Adds custom artifact creation. Adds the dead harvest effect

* Accidentally tinied

* PJBocalypse
This commit is contained in:
Skullyton
2017-02-04 15:50:41 +00:00
committed by Pieter-Jan Briers
parent 8836591e25
commit dd572ff592
3 changed files with 168 additions and 0 deletions

View File

@@ -3027,6 +3027,25 @@
to_chat(C, "<span class='danger'>A crate appears next to you. You think you can read \"[E.chosen_set]\" scribbled on it</span>")
U.turf_animation('icons/effects/96x96.dmi',"beamin",-WORLD_ICON_SIZE,0,MOB_LAYER+1,'sound/weapons/emitter2.ogg',anim_plane = MOB_PLANE)
message_admins("[key_name_admin(usr)] distributed experimental guns to the entire crew")
if("create_artifact")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","CA")
var/answer = alert("Are you sure you want to create a custom artifact?",,"Yes","No")
if(answer == "Yes")
//Either have them as all random, or have custom artifacts
var/list/effects = typesof(/datum/artifact_effect)
effects.Remove(/datum/artifact_effect)
var/answer1 = alert("Just a primary, or primary and secondary effects?",,"Primary only","Primary and Secondary")
var/primary_effect = input(usr, "Which primary effect would you like?", "Primary effect") as null|anything in effects
var/secondary_effect
if(answer1 == "Primary and Secondary")
secondary_effect = input(usr, "Which secondary effect would you like?", "Secondary effect") as null|anything in effects
var/obj/machinery/artifact/custom = new /obj/machinery/artifact(get_turf(usr))
custom.my_effect = new primary_effect(custom)
if(secondary_effect)
custom.secondary_effect = new secondary_effect(custom)
message_admins("[key_name_admin(usr)] has created a custom artifact")
if("schoolgirl")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","SG")

View File

@@ -0,0 +1,148 @@
/datum/artifact_effect/deadharvest
effecttype = "deadharvest"
var/list/mob_spawn = list()
var/points = 0
var/can_be_controlled = 0
var/mob/living/controller //Whomever is the leader of these brainless minions
/datum/artifact_effect/deadharvest/New()
..()
effect = pick(EFFECT_AURA, EFFECT_PULSE)
can_be_controlled = pick(0,1)
if(!mob_spawn.len)
new_mob_spawn_list()
/datum/artifact_effect/deadharvest/proc/new_mob_spawn_list(var/choice)
if(!choice)
choice = rand(4)
mob_spawn = list()
switch(choice)
if(1) //Regular necromancy mobs
mob_spawn = list(/mob/living/simple_animal/hostile/necro/zombie = 100,
/mob/living/simple_animal/hostile/necro/skeleton = 100,)
if(2) //Infection zombies
mob_spawn = list(/mob/living/simple_animal/hostile/necro/zombie/turned = 50,
/mob/living/simple_animal/hostile/necro/zombie/rotting = 75,
/mob/living/simple_animal/hostile/necro/zombie/putrid = 100,
/mob/living/simple_animal/hostile/necro/zombie/crimson = 250,)
if(3) //Necromorphs
mob_spawn = list(/mob/living/simple_animal/hostile/monster/necromorph = 150,) //More necromorph mobs when?
if(4) //Randomized mobs
var/max_mobs = rand(3,7)
for(var/i=0 to max_mobs)
var/mob/living/simple_animal/mob_to_add = pick(existing_typesof(/mob/living/simple_animal))
var/mob_cost = rand(5,25)*10
mob_spawn += mob_to_add
mob_spawn[mob_to_add] = mob_cost
/datum/artifact_effect/deadharvest/DoEffectTouch(var/mob/user)
if(!holder || !user)
return
if(isliving(user))
if(can_be_controlled)
if(!controller)
to_chat(user, "<span class = 'sinister'>You feel a slight biting sensation, which subsides.</span>")
controller = user
return
else
if(controller == user)
to_chat(user, "<span class = 'rose'>\The [holder] hums happily.</span>")
to_chat(user, "<span class = 'sinister'>[points]</span>")
return
harvest(user, 1)
spawn_creature()
/datum/artifact_effect/deadharvest/DoEffectPulse() //Does it in waves, so sensible to heal associates
if(!holder)
return
spawn_creature()
for(var/mob/living/L in range(src.effectrange,holder))
if(L.isDead())
if(ishuman(L))
var/weakness = 1-GetAnomalySusceptibility(L)
if(prob(weakness * 100))
continue
harvest(L, heal_associates = 1)
else
if(ishuman(L))
var/weakness = GetAnomalySusceptibility(L)
if(prob(weakness * 100))
to_chat(L, "<span class = 'sinister'>You [pick("feel tingly","are overcome with a sense of dread","feel incomplete")].</span>")
continue
/datum/artifact_effect/deadharvest/DoEffectAura() //Does it continuously, so not sensible to heal associates
if(!holder)
return
if(prob(10))
spawn_creature()
if(prob(50))
for (var/mob/living/L in range(src.effectrange*2, holder))
if(L.isDead())
if(ishuman(L))
var/weakness = 1-GetAnomalySusceptibility(L)
if(prob(weakness * 100))
continue
harvest(L)
/datum/artifact_effect/deadharvest/proc/harvest(var/mob/living/sacrifice, var/override, var/heal_associates)
if(!sacrifice)
return
if(!sacrifice.isDead() && !override) //No eating the living unless they come willingly
return
for(var/mob/living/summons in mob_spawn)
if(istype(summons, sacrifice)) //No sacrificing things we've summoned
if(heal_associates)
sacrifice.revive(0)
sacrifice.visible_message("<span class='warning'>\the [src] appears to wake from the dead, having healed all wounds.</span>")
return
if(iscarbon(sacrifice))
to_chat(sacrifice, "<span class = 'sinister'>You don't feel quite like yourself anymore.</span>")
points += 75
if(isanimal(sacrifice))
points += sacrifice.size*10
if(isrobot(sacrifice))
to_chat(sacrifice, "<span class = 'sinister'>Go away, we have no need for your twisted metal.</span>")
return
sacrifice.gib()
new /obj/effect/gibspawner/generic(get_turf(holder))
/datum/artifact_effect/deadharvest/proc/spawn_creature()
if(!mob_spawn.len)
new_mob_spawn_list()
var/mob/living/to_spawn = pick(mob_spawn)
var/points_required = mob_spawn[to_spawn]
if(points < points_required)
holder.visible_message("<span class = 'danger'>\The [holder] [pick("buzzes angrily","lets out a slight hiss of steam","pulses ominously")]</span>")
return 0
points -= points_required
var/list/randomturfs = new/list()
for(var/turf/simulated/floor/T in orange(holder, 2))
randomturfs.Add(T)
if(istype(to_spawn, /mob/living/simple_animal/hostile))
var/mob/living/simple_animal/hostile/animal_spawn = to_spawn
new animal_spawn(pick(randomturfs))
if(controller)
animal_spawn.friends.Add(controller)
else
new to_spawn(pick(randomturfs))
new /obj/effect/gibspawner/generic(get_turf(holder))

View File

@@ -1889,6 +1889,7 @@
#include "code\modules\research\xenoarchaeology\artifact\effects\unknown_effect_cultify.dm"
#include "code\modules\research\xenoarchaeology\artifact\effects\unknown_effect_darkness.dm"
#include "code\modules\research\xenoarchaeology\artifact\effects\unknown_effect_darkrevive.dm"
#include "code\modules\research\xenoarchaeology\artifact\effects\unknown_effect_deadharvest.dm"
#include "code\modules\research\xenoarchaeology\artifact\effects\unknown_effect_dnaswitch.dm"
#include "code\modules\research\xenoarchaeology\artifact\effects\unknown_effect_emp.dm"
#include "code\modules\research\xenoarchaeology\artifact\effects\unknown_effect_forcefield.dm"