Add sentience event

This commit is contained in:
Sam
2017-06-03 21:47:14 +01:00
parent 96678c1573
commit 5807cd69c0
3 changed files with 34 additions and 0 deletions
+1
View File
@@ -137,6 +137,7 @@ var/list/event_last_fired = list()
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Trivial News", /datum/event/trivial_news, 400),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Mundane News", /datum/event/mundane_news, 300),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Vermin Infestation",/datum/event/infestation, 100, list(ASSIGNMENT_JANITOR = 100)),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Sentience", /datum/event/sentience, 50),
new /datum/event_meta(EVENT_LEVEL_MUNDANE, "Wallrot", /datum/event/wallrot, 0, list(ASSIGNMENT_ENGINEER = 30, ASSIGNMENT_GARDENER = 50))
)
+32
View File
@@ -0,0 +1,32 @@
/datum/event/sentience
/datum/event/sentience/start()
var/ghostmsg = "Do you want to awaken as a sentient being?"
var/list/candidates = pollCandidates(ghostmsg, ROLE_SENTIENT, 1)
var/list/potential = list()
for(var/mob/living/simple_animal/L in living_mob_list)
var/turf/T = get_turf(L)
if (T.z != 1)
continue
if(!(L in player_list) && !L.mind)
potential += L
var/mob/living/simple_animal/SA = pick(potential)
var/mob/living/simple_animal/SG = pick(candidates)
if(!SA || !SG) //if you can't find either a simple animal or a player, end
return FALSE
SA.key = SG.key
SA.universal_speak = 1
SA.sentience_act()
SA.maxHealth = max(SA.maxHealth, 200)
SA.health = SA.maxHealth
SA.del_on_death = FALSE
greet_sentient(SA)
/datum/event/sentience/proc/greet_sentient(var/mob/living/carbon/human/M)
to_chat(M, "<span class='userdanger'>Hello world!</span>")
to_chat(M, "<span class='warning'>Due to freak radiation, you have gained \
human level intelligence and the ability to speak and understand \
and the ability to speak and understand human language!</span>")