Merge remote-tracking branch 'refs/remotes/origin/master' into custom_roundstart_items
# Conflicts: # code/controllers/configuration.dm # code/game/objects/items.dm
This commit is contained in:
@@ -81,9 +81,6 @@
|
||||
#define DNA_MUTANTTAIL_BLOCK 17
|
||||
#define DNA_MUTANTWING_BLOCK 18
|
||||
#define DNA_WINGCOLOR_BLOCK 19
|
||||
//#define DNA_SUBSPECIES_BLOCK 20
|
||||
//#define DNA_TAUR_BLOCK 21 //Taurs will be tails for now, easier - Pooj
|
||||
|
||||
#define DNA_STRUC_ENZYMES_BLOCKS 19
|
||||
#define DNA_UNIQUE_ENZYMES_LEN 32
|
||||
|
||||
@@ -128,9 +125,9 @@
|
||||
#define EASYLIMBATTACHMENT 23
|
||||
#define TOXINLOVER 24
|
||||
#define DIGITIGRADE 25 //Uses weird leg sprites. Optional for Lizards, required for ashwalkers. Don't give it to other races unless you make sprites for this (see human_parts_greyscale.dmi)
|
||||
#define MUTCOLORS2 26
|
||||
#define MUTCOLORS3 27
|
||||
#define NO_UNDERWEAR 26
|
||||
#define MUTCOLORS2 27
|
||||
#define MUTCOLORS3 28
|
||||
//citadel code
|
||||
#define NOAROUSAL 28//Stops all arousal effects
|
||||
#define NOGENITALS 29//Cannot create, use, or otherwise have genitals
|
||||
//#define SUBSPECIES 28
|
||||
#define NOAROUSAL 29//Stops all arousal effects
|
||||
#define NOGENITALS 30//Cannot create, use, or otherwise have genitals
|
||||
+8
-11
@@ -24,39 +24,36 @@
|
||||
|
||||
//SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier)
|
||||
|
||||
//subsystem should fire during pre-game lobby.
|
||||
#define SS_FIRE_IN_LOBBY 1
|
||||
|
||||
//subsystem does not initialize.
|
||||
#define SS_NO_INIT 2
|
||||
#define SS_NO_INIT 1
|
||||
|
||||
//subsystem does not fire.
|
||||
// (like can_fire = 0, but keeps it from getting added to the processing subsystems list)
|
||||
// (Requires a MC restart to change)
|
||||
#define SS_NO_FIRE 4
|
||||
#define SS_NO_FIRE 2
|
||||
|
||||
//subsystem only runs on spare cpu (after all non-background subsystems have ran that tick)
|
||||
// SS_BACKGROUND has its own priority bracket
|
||||
#define SS_BACKGROUND 8
|
||||
#define SS_BACKGROUND 4
|
||||
|
||||
//subsystem does not tick check, and should not run unless there is enough time (or its running behind (unless background))
|
||||
#define SS_NO_TICK_CHECK 16
|
||||
#define SS_NO_TICK_CHECK 8
|
||||
|
||||
//Treat wait as a tick count, not DS, run every wait ticks.
|
||||
// (also forces it to run first in the tick, above even SS_NO_TICK_CHECK subsystems)
|
||||
// (implies SS_FIRE_IN_LOBBY because of how it works)
|
||||
// (implies all runlevels because of how it works)
|
||||
// (overrides SS_BACKGROUND)
|
||||
// This is designed for basically anything that works as a mini-mc (like SStimer)
|
||||
#define SS_TICKER 32
|
||||
#define SS_TICKER 16
|
||||
|
||||
//keep the subsystem's timing on point by firing early if it fired late last fire because of lag
|
||||
// ie: if a 20ds subsystem fires say 5 ds late due to lag or what not, its next fire would be in 15ds, not 20ds.
|
||||
#define SS_KEEP_TIMING 64
|
||||
#define SS_KEEP_TIMING 32
|
||||
|
||||
//Calculate its next fire after its fired.
|
||||
// (IE: if a 5ds wait SS takes 2ds to run, its next fire should be 5ds away, not 3ds like it normally would be)
|
||||
// This flag overrides SS_KEEP_TIMING
|
||||
#define SS_POST_FIRE_TIMING 128
|
||||
#define SS_POST_FIRE_TIMING 64
|
||||
|
||||
//SUBSYSTEM STATES
|
||||
#define SS_IDLE 0 //aint doing shit.
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
#define ANTAG_DATUM_CULT /datum/antagonist/cult
|
||||
#define ANTAG_DATUM_CLOCKCULT /datum/antagonist/clockcult
|
||||
#define ANTAG_DATUM_CLOCKCULT_SILENT /datum/antagonist/clockcult/silent
|
||||
#define ANTAG_DATUM_CULT /datum/antagonist/cult
|
||||
#define ANTAG_DATUM_CULT_MASTER /datum/antagonist/cult/master
|
||||
#define ANTAG_DATUM_CLOCKCULT /datum/antagonist/clockcult
|
||||
#define ANTAG_DATUM_CLOCKCULT_SILENT /datum/antagonist/clockcult/silent
|
||||
#define ANTAG_DATUM_DEVIL /datum/antagonist/devil
|
||||
#define ANTAG_DATUM_NINJA /datum/antagonist/ninja
|
||||
#define ANTAG_DATUM_NINJA_FRIENDLY /datum/antagonist/ninja/friendly
|
||||
#define ANTAG_DATUM_NINJA_RANDOM /datum/antagonist/ninja/randomAllegiance/
|
||||
@@ -14,8 +14,9 @@
|
||||
#define GAS_META 3
|
||||
#define META_GAS_SPECIFIC_HEAT 1
|
||||
#define META_GAS_NAME 2
|
||||
#define META_GAS_OVERLAY 4
|
||||
#define META_GAS_MOLES_VISIBLE 3
|
||||
#define META_GAS_OVERLAY 4
|
||||
#define META_GAS_DANGER 5
|
||||
|
||||
//stuff you should probably leave well alone!
|
||||
//ATMOS
|
||||
@@ -169,4 +170,4 @@
|
||||
#define ATMOS_PASS_NO 0
|
||||
#define ATMOS_PASS_PROC -1 //ask CanAtmosPass()
|
||||
#define ATMOS_PASS_DENSITY -2 //just check density
|
||||
#define CANATMOSPASS(A, O) ( A.CanAtmosPass == ATMOS_PASS_PROC ? A.CanAtmosPass(O) : ( A.CanAtmosPass == ATMOS_PASS_DENSITY ? !A.density : A.CanAtmosPass ) )
|
||||
#define CANATMOSPASS(A, O) ( A.CanAtmosPass == ATMOS_PASS_PROC ? A.CanAtmosPass(O) : ( A.CanAtmosPass == ATMOS_PASS_DENSITY ? !A.density : A.CanAtmosPass ) )
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#define CONTRACT_PRESTIGE "prestige"
|
||||
#define CONTRACT_MAGIC "magic"
|
||||
#define CONTRACT_REVIVE "revive"
|
||||
#define CONTRACT_FRIEND "friend"
|
||||
#define CONTRACT_KNOWLEDGE "knowledge"
|
||||
#define CONTRACT_UNWILLING "unwilling"
|
||||
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
//rune colors, for easy reference
|
||||
#define RUNE_COLOR_TALISMAN "#0000FF"
|
||||
#define RUNE_COLOR_TELEPORT "#551A8B"
|
||||
#define RUNE_COLOR_OFFER "#FFFFFF"
|
||||
#define RUNE_COLOR_DARKRED "#7D1717"
|
||||
#define RUNE_COLOR_MEDIUMRED "#C80000"
|
||||
#define RUNE_COLOR_RED "#FF0000"
|
||||
#define RUNE_COLOR_EMP "#4D94FF"
|
||||
#define RUNE_COLOR_SUMMON "#00FF00"
|
||||
@@ -4,6 +4,8 @@
|
||||
#define ALL ~0 //For convenience.
|
||||
#define NONE 0
|
||||
|
||||
GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768))
|
||||
|
||||
//FLAGS BITMASK
|
||||
#define STOPSPRESSUREDMAGE 1 //This flag is used on the flags variable for SUIT and HEAD items which stop pressure damage. Note that the flag 1 was previous used as ONBACK, so it is possible for some code to use (flags & 1) when checking if something can be put on your back. Replace this code with (inv_flags & SLOT_BACK) if you see it anywhere
|
||||
//To successfully stop you taking all pressure damage you must have both a suit and head item with this flag.
|
||||
@@ -25,6 +27,7 @@
|
||||
#define BLOCK_GAS_SMOKE_EFFECT 4096 // blocks the effect that chemical clouds would have on a mob --glasses, mask and helmets ONLY!
|
||||
#define THICKMATERIAL 8192 //prevents syringes, parapens and hypos if the external suit or helmet (if targeting head) has this flag. Example: space suits, biosuit, bombsuits, thick suits that cover your body.
|
||||
#define DROPDEL 16384 // When dropped, it calls qdel on itself
|
||||
#define PREVENT_CLICK_UNDER 32768 //Prevent clicking things below it on the same turf eg. doors/ fulltile windows
|
||||
|
||||
/* Secondary atom flags, access using the SECONDARY_FLAG macros */
|
||||
|
||||
|
||||
+41
-41
@@ -1,43 +1,43 @@
|
||||
|
||||
#define ENGSEC (1<<0)
|
||||
|
||||
#define CAPTAIN (1<<0)
|
||||
#define HOS (1<<1)
|
||||
#define WARDEN (1<<2)
|
||||
#define DETECTIVE (1<<3)
|
||||
#define OFFICER (1<<4)
|
||||
#define CHIEF (1<<5)
|
||||
#define ENGINEER (1<<6)
|
||||
#define ATMOSTECH (1<<7)
|
||||
#define ROBOTICIST (1<<8)
|
||||
#define AI_JF (1<<9)
|
||||
#define CYBORG (1<<10)
|
||||
|
||||
|
||||
#define MEDSCI (1<<1)
|
||||
|
||||
#define RD_JF (1<<0)
|
||||
#define SCIENTIST (1<<1)
|
||||
#define CHEMIST (1<<2)
|
||||
#define CMO_JF (1<<3)
|
||||
#define DOCTOR (1<<4)
|
||||
#define GENETICIST (1<<5)
|
||||
#define VIROLOGIST (1<<6)
|
||||
|
||||
|
||||
#define CIVILIAN (1<<2)
|
||||
|
||||
#define HOP (1<<0)
|
||||
#define BARTENDER (1<<1)
|
||||
#define BOTANIST (1<<2)
|
||||
#define COOK (1<<3)
|
||||
#define JANITOR (1<<4)
|
||||
|
||||
#define ENGSEC (1<<0)
|
||||
|
||||
#define CAPTAIN (1<<0)
|
||||
#define HOS (1<<1)
|
||||
#define WARDEN (1<<2)
|
||||
#define DETECTIVE (1<<3)
|
||||
#define OFFICER (1<<4)
|
||||
#define CHIEF (1<<5)
|
||||
#define ENGINEER (1<<6)
|
||||
#define ATMOSTECH (1<<7)
|
||||
#define ROBOTICIST (1<<8)
|
||||
#define AI_JF (1<<9)
|
||||
#define CYBORG (1<<10)
|
||||
|
||||
|
||||
#define MEDSCI (1<<1)
|
||||
|
||||
#define RD_JF (1<<0)
|
||||
#define SCIENTIST (1<<1)
|
||||
#define CHEMIST (1<<2)
|
||||
#define CMO_JF (1<<3)
|
||||
#define DOCTOR (1<<4)
|
||||
#define GENETICIST (1<<5)
|
||||
#define VIROLOGIST (1<<6)
|
||||
|
||||
|
||||
#define CIVILIAN (1<<2)
|
||||
|
||||
#define HOP (1<<0)
|
||||
#define BARTENDER (1<<1)
|
||||
#define BOTANIST (1<<2)
|
||||
#define COOK (1<<3)
|
||||
#define JANITOR (1<<4)
|
||||
#define CURATOR (1<<5)
|
||||
#define QUARTERMASTER (1<<6)
|
||||
#define CARGOTECH (1<<7)
|
||||
#define MINER (1<<8)
|
||||
#define LAWYER (1<<9)
|
||||
#define CHAPLAIN (1<<10)
|
||||
#define CLOWN (1<<11)
|
||||
#define MIME (1<<12)
|
||||
#define QUARTERMASTER (1<<6)
|
||||
#define CARGOTECH (1<<7)
|
||||
#define MINER (1<<8)
|
||||
#define LAWYER (1<<9)
|
||||
#define CHAPLAIN (1<<10)
|
||||
#define CLOWN (1<<11)
|
||||
#define MIME (1<<12)
|
||||
#define ASSISTANT (1<<13)
|
||||
@@ -2,3 +2,6 @@
|
||||
#define TONGUELESS_SPEECH 2
|
||||
#define LANGUAGE_HIDE_ICON_IF_UNDERSTOOD 4
|
||||
#define LANGUAGE_HIDE_ICON_IF_NOT_UNDERSTOOD 8
|
||||
|
||||
#define LANGUAGE_KNOWN "language_known"
|
||||
#define LANGUAGE_SHADOWED "language_shadowed"
|
||||
|
||||
@@ -407,3 +407,7 @@ GLOBAL_LIST_INIT(ghost_others_options, list(GHOST_OTHERS_SIMPLE, GHOST_OTHERS_DE
|
||||
|
||||
//Error handler defines
|
||||
#define ERROR_USEFUL_LEN 2
|
||||
|
||||
#define NO_FIELD 0
|
||||
#define FIELD_TURF 1
|
||||
#define FIELD_EDGE 2
|
||||
|
||||
@@ -38,3 +38,5 @@
|
||||
#define MANIA_DAMAGE_TO_CONVERT 90 //how much damage is required before it'll convert affected targets
|
||||
|
||||
#define STATUS_EFFECT_HISWRATH /datum/status_effect/his_wrath //His Wrath.
|
||||
|
||||
#define STATUS_EFFECT_SUMMONEDGHOST /datum/status_effect/cultghost //is a cult ghost and can't use manifest runes
|
||||
@@ -1,10 +0,0 @@
|
||||
diff a/code/__DEFINES/status_effects.dm b/code/__DEFINES/status_effects.dm (rejected hunks)
|
||||
@@ -33,4 +33,8 @@
|
||||
#define STATUS_EFFECT_SIGILMARK /datum/status_effect/sigil_mark
|
||||
#define STATUS_EFFECT_BELLIGERENT /datum/status_effect/belligerent //forces the affected to walk, doing damage if they try to run
|
||||
|
||||
+#define STATUS_EFFECT_MANIAMOTOR /datum/status_effect/maniamotor //disrupts, damages, and confuses the affected as long as they're in range of the motor
|
||||
+#define MAX_MANIA_SEVERITY 100 //how high the mania severity can go
|
||||
+#define MANIA_DAMAGE_TO_CONVERT 90 //how much damage is required before it'll convert affected targets
|
||||
+
|
||||
#define STATUS_EFFECT_HISWRATH /datum/status_effect/his_wrath //His Wrath.
|
||||
@@ -46,6 +46,7 @@
|
||||
#define INIT_ORDER_TICKER 13
|
||||
#define INIT_ORDER_MAPPING 12
|
||||
#define INIT_ORDER_ATOMS 11
|
||||
#define INIT_ORDER_LANGUAGE 10
|
||||
#define INIT_ORDER_MACHINES 9
|
||||
#define INIT_ORDER_SHUTTLE 3
|
||||
#define INIT_ORDER_TIMER 1
|
||||
@@ -60,3 +61,13 @@
|
||||
#define INIT_ORDER_LIGHTING -20
|
||||
#define INIT_ORDER_SQUEAK -40
|
||||
#define INIT_ORDER_PERSISTENCE -100
|
||||
|
||||
// SS runlevels
|
||||
|
||||
#define RUNLEVEL_INIT 0
|
||||
#define RUNLEVEL_LOBBY 1
|
||||
#define RUNLEVEL_SETUP 2
|
||||
#define RUNLEVEL_GAME 4
|
||||
#define RUNLEVEL_POSTGAME 8
|
||||
|
||||
#define RUNLEVELS_DEFAULT (RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME)
|
||||
+490
-490
@@ -1,491 +1,491 @@
|
||||
/*
|
||||
* Holds procs to help with list operations
|
||||
* Contains groups:
|
||||
* Misc
|
||||
* Sorting
|
||||
*/
|
||||
|
||||
/*
|
||||
* Misc
|
||||
*/
|
||||
|
||||
//Returns a list in plain english as a string
|
||||
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
|
||||
var/total = input.len
|
||||
if (!total)
|
||||
return "[nothing_text]"
|
||||
else if (total == 1)
|
||||
return "[input[1]]"
|
||||
else if (total == 2)
|
||||
return "[input[1]][and_text][input[2]]"
|
||||
else
|
||||
var/output = ""
|
||||
var/index = 1
|
||||
while (index < total)
|
||||
if (index == total - 1)
|
||||
comma_text = final_comma_text
|
||||
|
||||
output += "[input[index]][comma_text]"
|
||||
index++
|
||||
|
||||
return "[output][and_text][input[index]]"
|
||||
|
||||
//Returns list element or null. Should prevent "index out of bounds" error.
|
||||
/proc/listgetindex(list/L, index)
|
||||
if(istype(L))
|
||||
if(isnum(index) && IsInteger(index))
|
||||
if(IsInRange(index,1,L.len))
|
||||
return L[index]
|
||||
else if(index in L)
|
||||
return L[index]
|
||||
return
|
||||
|
||||
//Return either pick(list) or null if list is not of type /list or is empty
|
||||
/proc/safepick(list/L)
|
||||
if(istype(L) && L.len)
|
||||
return pick(L)
|
||||
|
||||
//Checks if the list is empty
|
||||
/proc/isemptylist(list/L)
|
||||
if(!L.len)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//Checks for specific types in a list
|
||||
/proc/is_type_in_list(atom/A, list/L)
|
||||
if(!L || !L.len || !A)
|
||||
return 0
|
||||
for(var/type in L)
|
||||
if(istype(A, type))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//Checks for specific types in specifically structured (Assoc "type" = TRUE) lists ('typecaches')
|
||||
/proc/is_type_in_typecache(atom/A, list/L)
|
||||
if(!L || !L.len || !A)
|
||||
|
||||
return 0
|
||||
if(ispath(A))
|
||||
. = L[A]
|
||||
else
|
||||
. = L[A.type]
|
||||
|
||||
//Checks for a string in a list
|
||||
/proc/is_string_in_list(string, list/L)
|
||||
if(!L || !L.len || !string)
|
||||
return
|
||||
for(var/V in L)
|
||||
if(string == V)
|
||||
return 1
|
||||
return
|
||||
|
||||
//Removes a string from a list
|
||||
/proc/remove_strings_from_list(string, list/L)
|
||||
if(!L || !L.len || !string)
|
||||
return
|
||||
for(var/V in L)
|
||||
if(V == string)
|
||||
L -= V //No return here so that it removes all strings of that type
|
||||
return
|
||||
|
||||
//returns a new list with only atoms that are in typecache L
|
||||
/proc/typecache_filter_list(list/atoms, list/typecache)
|
||||
. = list()
|
||||
for (var/thing in atoms)
|
||||
var/atom/A = thing
|
||||
if (typecache[A.type])
|
||||
. += A
|
||||
|
||||
//Like typesof() or subtypesof(), but returns a typecache instead of a list
|
||||
/proc/typecacheof(path, ignore_root_path, only_root_path = FALSE)
|
||||
if(ispath(path))
|
||||
var/list/types = list()
|
||||
if(only_root_path)
|
||||
types = list(path)
|
||||
else
|
||||
types = ignore_root_path ? subtypesof(path) : typesof(path)
|
||||
var/list/L = list()
|
||||
for(var/T in types)
|
||||
L[T] = TRUE
|
||||
return L
|
||||
else if(islist(path))
|
||||
var/list/pathlist = path
|
||||
var/list/L = list()
|
||||
if(ignore_root_path)
|
||||
for(var/P in pathlist)
|
||||
for(var/T in subtypesof(P))
|
||||
L[T] = TRUE
|
||||
else
|
||||
for(var/P in pathlist)
|
||||
if(only_root_path)
|
||||
L[P] = TRUE
|
||||
else
|
||||
for(var/T in typesof(P))
|
||||
L[T] = TRUE
|
||||
return L
|
||||
|
||||
//Empties the list by setting the length to 0. Hopefully the elements get garbage collected
|
||||
/proc/clearlist(list/list)
|
||||
if(istype(list))
|
||||
list.len = 0
|
||||
return
|
||||
|
||||
//Removes any null entries from the list
|
||||
/proc/listclearnulls(list/L)
|
||||
var/list/N = new(L.len)
|
||||
L -= N
|
||||
|
||||
/*
|
||||
* Returns list containing all the entries from first list that are not present in second.
|
||||
* If skiprep = 1, repeated elements are treated as one.
|
||||
* If either of arguments is not a list, returns null
|
||||
*/
|
||||
/proc/difflist(list/first, list/second, skiprep=0)
|
||||
if(!islist(first) || !islist(second))
|
||||
return
|
||||
var/list/result = new
|
||||
if(skiprep)
|
||||
for(var/e in first)
|
||||
if(!(e in result) && !(e in second))
|
||||
result += e
|
||||
else
|
||||
result = first - second
|
||||
return result
|
||||
|
||||
/*
|
||||
* Returns list containing entries that are in either list but not both.
|
||||
* If skipref = 1, repeated elements are treated as one.
|
||||
* If either of arguments is not a list, returns null
|
||||
*/
|
||||
/proc/uniquemergelist(list/first, list/second, skiprep=0)
|
||||
if(!islist(first) || !islist(second))
|
||||
return
|
||||
var/list/result = new
|
||||
if(skiprep)
|
||||
result = difflist(first, second, skiprep)+difflist(second, first, skiprep)
|
||||
else
|
||||
result = first ^ second
|
||||
return result
|
||||
|
||||
//Pretends to pick an element based on its weight but really just seems to pick a random element.
|
||||
/proc/pickweight(list/L)
|
||||
var/total = 0
|
||||
var/item
|
||||
for (item in L)
|
||||
if (!L[item])
|
||||
L[item] = 1
|
||||
total += L[item]
|
||||
|
||||
total = rand(1, total)
|
||||
for (item in L)
|
||||
total -=L [item]
|
||||
if (total <= 0)
|
||||
return item
|
||||
|
||||
return null
|
||||
|
||||
//Pick a random element from the list and remove it from the list.
|
||||
/proc/pick_n_take(list/L)
|
||||
if(L.len)
|
||||
var/picked = rand(1,L.len)
|
||||
. = L[picked]
|
||||
L.Cut(picked,picked+1) //Cut is far more efficient that Remove()
|
||||
|
||||
//Returns the top(last) element from the list and removes it from the list (typical stack function)
|
||||
/proc/pop(list/L)
|
||||
if(L.len)
|
||||
. = L[L.len]
|
||||
L.len--
|
||||
|
||||
/proc/popleft(list/L)
|
||||
if(L.len)
|
||||
. = L[1]
|
||||
L.Cut(1,2)
|
||||
|
||||
/proc/sorted_insert(list/L, thing, comparator)
|
||||
var/pos = L.len
|
||||
while(pos > 0 && call(comparator)(thing, L[pos]) > 0)
|
||||
pos--
|
||||
L.Insert(pos+1, thing)
|
||||
|
||||
// Returns the next item in a list
|
||||
/proc/next_list_item(item, list/L)
|
||||
var/i
|
||||
i = L.Find(item)
|
||||
if(i == L.len)
|
||||
i = 1
|
||||
else
|
||||
i++
|
||||
return L[i]
|
||||
|
||||
// Returns the previous item in a list
|
||||
/proc/previous_list_item(item, list/L)
|
||||
var/i
|
||||
i = L.Find(item)
|
||||
if(i == 1)
|
||||
i = L.len
|
||||
else
|
||||
i--
|
||||
return L[i]
|
||||
|
||||
//Randomize: Return the list in a random order
|
||||
/proc/shuffle(list/L)
|
||||
if(!L)
|
||||
return
|
||||
L = L.Copy()
|
||||
|
||||
for(var/i=1, i<L.len, ++i)
|
||||
L.Swap(i,rand(i,L.len))
|
||||
|
||||
return L
|
||||
|
||||
//same, but returns nothing and acts on list in place
|
||||
/proc/shuffle_inplace(list/L)
|
||||
if(!L)
|
||||
return
|
||||
|
||||
for(var/i=1, i<L.len, ++i)
|
||||
L.Swap(i,rand(i,L.len))
|
||||
|
||||
//Return a list with no duplicate entries
|
||||
/proc/uniqueList(list/L)
|
||||
. = list()
|
||||
for(var/i in L)
|
||||
. |= i
|
||||
|
||||
//same, but returns nothing and acts on list in place (also handles associated values properly)
|
||||
/proc/uniqueList_inplace(list/L)
|
||||
var/temp = L.Copy()
|
||||
L.len = 0
|
||||
for(var/key in temp)
|
||||
if (isnum(key))
|
||||
L |= key
|
||||
else
|
||||
L[key] = temp[key]
|
||||
|
||||
//for sorting clients or mobs by ckey
|
||||
/proc/sortKey(list/L, order=1)
|
||||
return sortTim(L, order >= 0 ? /proc/cmp_ckey_asc : /proc/cmp_ckey_dsc)
|
||||
|
||||
//Specifically for record datums in a list.
|
||||
/proc/sortRecord(list/L, field = "name", order = 1)
|
||||
GLOB.cmp_field = field
|
||||
return sortTim(L, order >= 0 ? /proc/cmp_records_asc : /proc/cmp_records_dsc)
|
||||
|
||||
//any value in a list
|
||||
/proc/sortList(list/L, cmp=/proc/cmp_text_asc)
|
||||
return sortTim(L.Copy(), cmp)
|
||||
|
||||
//uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead
|
||||
/proc/sortNames(list/L, order=1)
|
||||
return sortTim(L, order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc)
|
||||
|
||||
|
||||
//Converts a bitfield to a list of numbers (or words if a wordlist is provided)
|
||||
/proc/bitfield2list(bitfield = 0, list/wordlist)
|
||||
var/list/r = list()
|
||||
if(istype(wordlist,/list))
|
||||
var/max = min(wordlist.len,16)
|
||||
var/bit = 1
|
||||
for(var/i=1, i<=max, i++)
|
||||
if(bitfield & bit)
|
||||
r += wordlist[i]
|
||||
bit = bit << 1
|
||||
else
|
||||
for(var/bit=1, bit<=65535, bit = bit << 1)
|
||||
if(bitfield & bit)
|
||||
r += bit
|
||||
|
||||
return r
|
||||
|
||||
// Returns the key based on the index
|
||||
#define KEYBYINDEX(L, index) (((index <= L:len) && (index > 0)) ? L[index] : null)
|
||||
|
||||
/proc/count_by_type(list/L, type)
|
||||
var/i = 0
|
||||
for(var/T in L)
|
||||
if(istype(T, type))
|
||||
i++
|
||||
return i
|
||||
|
||||
/proc/find_record(field, value, list/L)
|
||||
for(var/datum/data/record/R in L)
|
||||
if(R.fields[field] == value)
|
||||
return R
|
||||
|
||||
|
||||
//Move a single element from position fromIndex within a list, to position toIndex
|
||||
//All elements in the range [1,toIndex) before the move will be before the pivot afterwards
|
||||
//All elements in the range [toIndex, L.len+1) before the move will be after the pivot afterwards
|
||||
//In other words, it's as if the range [fromIndex,toIndex) have been rotated using a <<< operation common to other languages.
|
||||
//fromIndex and toIndex must be in the range [1,L.len+1]
|
||||
//This will preserve associations ~Carnie
|
||||
/proc/moveElement(list/L, fromIndex, toIndex)
|
||||
if(fromIndex == toIndex || fromIndex+1 == toIndex) //no need to move
|
||||
return
|
||||
if(fromIndex > toIndex)
|
||||
++fromIndex //since a null will be inserted before fromIndex, the index needs to be nudged right by one
|
||||
|
||||
L.Insert(toIndex, null)
|
||||
L.Swap(fromIndex, toIndex)
|
||||
L.Cut(fromIndex, fromIndex+1)
|
||||
|
||||
|
||||
//Move elements [fromIndex,fromIndex+len) to [toIndex-len, toIndex)
|
||||
//Same as moveElement but for ranges of elements
|
||||
//This will preserve associations ~Carnie
|
||||
/proc/moveRange(list/L, fromIndex, toIndex, len=1)
|
||||
var/distance = abs(toIndex - fromIndex)
|
||||
if(len >= distance) //there are more elements to be moved than the distance to be moved. Therefore the same result can be achieved (with fewer operations) by moving elements between where we are and where we are going. The result being, our range we are moving is shifted left or right by dist elements
|
||||
if(fromIndex <= toIndex)
|
||||
return //no need to move
|
||||
fromIndex += len //we want to shift left instead of right
|
||||
|
||||
for(var/i=0, i<distance, ++i)
|
||||
L.Insert(fromIndex, null)
|
||||
L.Swap(fromIndex, toIndex)
|
||||
L.Cut(toIndex, toIndex+1)
|
||||
else
|
||||
if(fromIndex > toIndex)
|
||||
fromIndex += len
|
||||
|
||||
for(var/i=0, i<len, ++i)
|
||||
L.Insert(toIndex, null)
|
||||
L.Swap(fromIndex, toIndex)
|
||||
L.Cut(fromIndex, fromIndex+1)
|
||||
|
||||
//Move elements from [fromIndex, fromIndex+len) to [toIndex, toIndex+len)
|
||||
//Move any elements being overwritten by the move to the now-empty elements, preserving order
|
||||
//Note: if the two ranges overlap, only the destination order will be preserved fully, since some elements will be within both ranges ~Carnie
|
||||
/proc/swapRange(list/L, fromIndex, toIndex, len=1)
|
||||
var/distance = abs(toIndex - fromIndex)
|
||||
if(len > distance) //there is an overlap, therefore swapping each element will require more swaps than inserting new elements
|
||||
if(fromIndex < toIndex)
|
||||
toIndex += len
|
||||
else
|
||||
fromIndex += len
|
||||
|
||||
for(var/i=0, i<distance, ++i)
|
||||
L.Insert(fromIndex, null)
|
||||
L.Swap(fromIndex, toIndex)
|
||||
L.Cut(toIndex, toIndex+1)
|
||||
else
|
||||
if(toIndex > fromIndex)
|
||||
var/a = toIndex
|
||||
toIndex = fromIndex
|
||||
fromIndex = a
|
||||
|
||||
for(var/i=0, i<len, ++i)
|
||||
L.Swap(fromIndex++, toIndex++)
|
||||
|
||||
//replaces reverseList ~Carnie
|
||||
/proc/reverseRange(list/L, start=1, end=0)
|
||||
if(L.len)
|
||||
start = start % L.len
|
||||
end = end % (L.len+1)
|
||||
if(start <= 0)
|
||||
start += L.len
|
||||
if(end <= 0)
|
||||
end += L.len + 1
|
||||
|
||||
--end
|
||||
while(start < end)
|
||||
L.Swap(start++,end--)
|
||||
|
||||
return L
|
||||
|
||||
|
||||
//return first thing in L which has var/varname == value
|
||||
//this is typecaste as list/L, but you could actually feed it an atom instead.
|
||||
//completely safe to use
|
||||
/proc/getElementByVar(list/L, varname, value)
|
||||
varname = "[varname]"
|
||||
for(var/datum/D in L)
|
||||
if(D.vars.Find(varname))
|
||||
if(D.vars[varname] == value)
|
||||
return D
|
||||
|
||||
//remove all nulls from a list
|
||||
/proc/removeNullsFromList(list/L)
|
||||
while(L.Remove(null))
|
||||
continue
|
||||
return L
|
||||
|
||||
//Copies a list, and all lists inside it recusively
|
||||
//Does not copy any other reference type
|
||||
/proc/deepCopyList(list/l)
|
||||
if(!islist(l))
|
||||
return l
|
||||
. = l.Copy()
|
||||
for(var/i = 1 to l.len)
|
||||
if(islist(.[i]))
|
||||
.[i] = .(.[i])
|
||||
|
||||
//takes an input_key, as text, and the list of keys already used, outputting a replacement key in the format of "[input_key] ([number_of_duplicates])" if it finds a duplicate
|
||||
//use this for lists of things that might have the same name, like mobs or objects, that you plan on giving to a player as input
|
||||
/proc/avoid_assoc_duplicate_keys(input_key, list/used_key_list)
|
||||
if(!input_key || !istype(used_key_list))
|
||||
return
|
||||
if(used_key_list[input_key])
|
||||
used_key_list[input_key]++
|
||||
input_key = "[input_key] ([used_key_list[input_key]])"
|
||||
else
|
||||
used_key_list[input_key] = 1
|
||||
return input_key
|
||||
|
||||
#if DM_VERSION > 512
|
||||
#error Remie said that lummox was adding a way to get a lists
|
||||
#error contents via list.values, if that is true remove this
|
||||
#error otherwise, update the version and bug lummox
|
||||
#elseif
|
||||
//Flattens a keyed list into a list of it's contents
|
||||
/proc/flatten_list(list/key_list)
|
||||
if(!islist(key_list))
|
||||
return null
|
||||
. = list()
|
||||
for(var/key in key_list)
|
||||
. |= key_list[key]
|
||||
|
||||
//Picks from the list, with some safeties, and returns the "default" arg if it fails
|
||||
#define DEFAULTPICK(L, default) ((istype(L, /list) && L:len) ? pick(L) : default)
|
||||
|
||||
#define LAZYINITLIST(L) if (!L) L = list()
|
||||
|
||||
#define UNSETEMPTY(L) if (L && !L.len) L = null
|
||||
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!L.len) { L = null; } }
|
||||
#define LAZYADD(L, I) if(!L) { L = list(); } L += I;
|
||||
#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= L.len ? L[I] : null) : L[I]) : null)
|
||||
#define LAZYLEN(L) length(L)
|
||||
#define LAZYCLEARLIST(L) if(L) L.Cut()
|
||||
/*
|
||||
* Holds procs to help with list operations
|
||||
* Contains groups:
|
||||
* Misc
|
||||
* Sorting
|
||||
*/
|
||||
|
||||
/*
|
||||
* Misc
|
||||
*/
|
||||
|
||||
//Returns a list in plain english as a string
|
||||
/proc/english_list(list/input, nothing_text = "nothing", and_text = " and ", comma_text = ", ", final_comma_text = "" )
|
||||
var/total = input.len
|
||||
if (!total)
|
||||
return "[nothing_text]"
|
||||
else if (total == 1)
|
||||
return "[input[1]]"
|
||||
else if (total == 2)
|
||||
return "[input[1]][and_text][input[2]]"
|
||||
else
|
||||
var/output = ""
|
||||
var/index = 1
|
||||
while (index < total)
|
||||
if (index == total - 1)
|
||||
comma_text = final_comma_text
|
||||
|
||||
output += "[input[index]][comma_text]"
|
||||
index++
|
||||
|
||||
return "[output][and_text][input[index]]"
|
||||
|
||||
//Returns list element or null. Should prevent "index out of bounds" error.
|
||||
/proc/listgetindex(list/L, index)
|
||||
if(istype(L))
|
||||
if(isnum(index) && IsInteger(index))
|
||||
if(IsInRange(index,1,L.len))
|
||||
return L[index]
|
||||
else if(index in L)
|
||||
return L[index]
|
||||
return
|
||||
|
||||
//Return either pick(list) or null if list is not of type /list or is empty
|
||||
/proc/safepick(list/L)
|
||||
if(istype(L) && L.len)
|
||||
return pick(L)
|
||||
|
||||
//Checks if the list is empty
|
||||
/proc/isemptylist(list/L)
|
||||
if(!L.len)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//Checks for specific types in a list
|
||||
/proc/is_type_in_list(atom/A, list/L)
|
||||
if(!L || !L.len || !A)
|
||||
return 0
|
||||
for(var/type in L)
|
||||
if(istype(A, type))
|
||||
return 1
|
||||
return 0
|
||||
|
||||
//Checks for specific types in specifically structured (Assoc "type" = TRUE) lists ('typecaches')
|
||||
/proc/is_type_in_typecache(atom/A, list/L)
|
||||
if(!L || !L.len || !A)
|
||||
|
||||
return 0
|
||||
if(ispath(A))
|
||||
. = L[A]
|
||||
else
|
||||
. = L[A.type]
|
||||
|
||||
//Checks for a string in a list
|
||||
/proc/is_string_in_list(string, list/L)
|
||||
if(!L || !L.len || !string)
|
||||
return
|
||||
for(var/V in L)
|
||||
if(string == V)
|
||||
return 1
|
||||
return
|
||||
|
||||
//Removes a string from a list
|
||||
/proc/remove_strings_from_list(string, list/L)
|
||||
if(!L || !L.len || !string)
|
||||
return
|
||||
for(var/V in L)
|
||||
if(V == string)
|
||||
L -= V //No return here so that it removes all strings of that type
|
||||
return
|
||||
|
||||
//returns a new list with only atoms that are in typecache L
|
||||
/proc/typecache_filter_list(list/atoms, list/typecache)
|
||||
. = list()
|
||||
for (var/thing in atoms)
|
||||
var/atom/A = thing
|
||||
if (typecache[A.type])
|
||||
. += A
|
||||
|
||||
//Like typesof() or subtypesof(), but returns a typecache instead of a list
|
||||
/proc/typecacheof(path, ignore_root_path, only_root_path = FALSE)
|
||||
if(ispath(path))
|
||||
var/list/types = list()
|
||||
if(only_root_path)
|
||||
types = list(path)
|
||||
else
|
||||
types = ignore_root_path ? subtypesof(path) : typesof(path)
|
||||
var/list/L = list()
|
||||
for(var/T in types)
|
||||
L[T] = TRUE
|
||||
return L
|
||||
else if(islist(path))
|
||||
var/list/pathlist = path
|
||||
var/list/L = list()
|
||||
if(ignore_root_path)
|
||||
for(var/P in pathlist)
|
||||
for(var/T in subtypesof(P))
|
||||
L[T] = TRUE
|
||||
else
|
||||
for(var/P in pathlist)
|
||||
if(only_root_path)
|
||||
L[P] = TRUE
|
||||
else
|
||||
for(var/T in typesof(P))
|
||||
L[T] = TRUE
|
||||
return L
|
||||
|
||||
//Empties the list by setting the length to 0. Hopefully the elements get garbage collected
|
||||
/proc/clearlist(list/list)
|
||||
if(istype(list))
|
||||
list.len = 0
|
||||
return
|
||||
|
||||
//Removes any null entries from the list
|
||||
/proc/listclearnulls(list/L)
|
||||
var/list/N = new(L.len)
|
||||
L -= N
|
||||
|
||||
/*
|
||||
* Returns list containing all the entries from first list that are not present in second.
|
||||
* If skiprep = 1, repeated elements are treated as one.
|
||||
* If either of arguments is not a list, returns null
|
||||
*/
|
||||
/proc/difflist(list/first, list/second, skiprep=0)
|
||||
if(!islist(first) || !islist(second))
|
||||
return
|
||||
var/list/result = new
|
||||
if(skiprep)
|
||||
for(var/e in first)
|
||||
if(!(e in result) && !(e in second))
|
||||
result += e
|
||||
else
|
||||
result = first - second
|
||||
return result
|
||||
|
||||
/*
|
||||
* Returns list containing entries that are in either list but not both.
|
||||
* If skipref = 1, repeated elements are treated as one.
|
||||
* If either of arguments is not a list, returns null
|
||||
*/
|
||||
/proc/uniquemergelist(list/first, list/second, skiprep=0)
|
||||
if(!islist(first) || !islist(second))
|
||||
return
|
||||
var/list/result = new
|
||||
if(skiprep)
|
||||
result = difflist(first, second, skiprep)+difflist(second, first, skiprep)
|
||||
else
|
||||
result = first ^ second
|
||||
return result
|
||||
|
||||
//Pretends to pick an element based on its weight but really just seems to pick a random element.
|
||||
/proc/pickweight(list/L)
|
||||
var/total = 0
|
||||
var/item
|
||||
for (item in L)
|
||||
if (!L[item])
|
||||
L[item] = 1
|
||||
total += L[item]
|
||||
|
||||
total = rand(1, total)
|
||||
for (item in L)
|
||||
total -=L [item]
|
||||
if (total <= 0)
|
||||
return item
|
||||
|
||||
return null
|
||||
|
||||
//Pick a random element from the list and remove it from the list.
|
||||
/proc/pick_n_take(list/L)
|
||||
if(L.len)
|
||||
var/picked = rand(1,L.len)
|
||||
. = L[picked]
|
||||
L.Cut(picked,picked+1) //Cut is far more efficient that Remove()
|
||||
|
||||
//Returns the top(last) element from the list and removes it from the list (typical stack function)
|
||||
/proc/pop(list/L)
|
||||
if(L.len)
|
||||
. = L[L.len]
|
||||
L.len--
|
||||
|
||||
/proc/popleft(list/L)
|
||||
if(L.len)
|
||||
. = L[1]
|
||||
L.Cut(1,2)
|
||||
|
||||
/proc/sorted_insert(list/L, thing, comparator)
|
||||
var/pos = L.len
|
||||
while(pos > 0 && call(comparator)(thing, L[pos]) > 0)
|
||||
pos--
|
||||
L.Insert(pos+1, thing)
|
||||
|
||||
// Returns the next item in a list
|
||||
/proc/next_list_item(item, list/L)
|
||||
var/i
|
||||
i = L.Find(item)
|
||||
if(i == L.len)
|
||||
i = 1
|
||||
else
|
||||
i++
|
||||
return L[i]
|
||||
|
||||
// Returns the previous item in a list
|
||||
/proc/previous_list_item(item, list/L)
|
||||
var/i
|
||||
i = L.Find(item)
|
||||
if(i == 1)
|
||||
i = L.len
|
||||
else
|
||||
i--
|
||||
return L[i]
|
||||
|
||||
//Randomize: Return the list in a random order
|
||||
/proc/shuffle(list/L)
|
||||
if(!L)
|
||||
return
|
||||
L = L.Copy()
|
||||
|
||||
for(var/i=1, i<L.len, ++i)
|
||||
L.Swap(i,rand(i,L.len))
|
||||
|
||||
return L
|
||||
|
||||
//same, but returns nothing and acts on list in place
|
||||
/proc/shuffle_inplace(list/L)
|
||||
if(!L)
|
||||
return
|
||||
|
||||
for(var/i=1, i<L.len, ++i)
|
||||
L.Swap(i,rand(i,L.len))
|
||||
|
||||
//Return a list with no duplicate entries
|
||||
/proc/uniqueList(list/L)
|
||||
. = list()
|
||||
for(var/i in L)
|
||||
. |= i
|
||||
|
||||
//same, but returns nothing and acts on list in place (also handles associated values properly)
|
||||
/proc/uniqueList_inplace(list/L)
|
||||
var/temp = L.Copy()
|
||||
L.len = 0
|
||||
for(var/key in temp)
|
||||
if (isnum(key))
|
||||
L |= key
|
||||
else
|
||||
L[key] = temp[key]
|
||||
|
||||
//for sorting clients or mobs by ckey
|
||||
/proc/sortKey(list/L, order=1)
|
||||
return sortTim(L, order >= 0 ? /proc/cmp_ckey_asc : /proc/cmp_ckey_dsc)
|
||||
|
||||
//Specifically for record datums in a list.
|
||||
/proc/sortRecord(list/L, field = "name", order = 1)
|
||||
GLOB.cmp_field = field
|
||||
return sortTim(L, order >= 0 ? /proc/cmp_records_asc : /proc/cmp_records_dsc)
|
||||
|
||||
//any value in a list
|
||||
/proc/sortList(list/L, cmp=/proc/cmp_text_asc)
|
||||
return sortTim(L.Copy(), cmp)
|
||||
|
||||
//uses sortList() but uses the var's name specifically. This should probably be using mergeAtom() instead
|
||||
/proc/sortNames(list/L, order=1)
|
||||
return sortTim(L, order >= 0 ? /proc/cmp_name_asc : /proc/cmp_name_dsc)
|
||||
|
||||
|
||||
//Converts a bitfield to a list of numbers (or words if a wordlist is provided)
|
||||
/proc/bitfield2list(bitfield = 0, list/wordlist)
|
||||
var/list/r = list()
|
||||
if(istype(wordlist,/list))
|
||||
var/max = min(wordlist.len,16)
|
||||
var/bit = 1
|
||||
for(var/i=1, i<=max, i++)
|
||||
if(bitfield & bit)
|
||||
r += wordlist[i]
|
||||
bit = bit << 1
|
||||
else
|
||||
for(var/bit=1, bit<=65535, bit = bit << 1)
|
||||
if(bitfield & bit)
|
||||
r += bit
|
||||
|
||||
return r
|
||||
|
||||
// Returns the key based on the index
|
||||
#define KEYBYINDEX(L, index) (((index <= L:len) && (index > 0)) ? L[index] : null)
|
||||
|
||||
/proc/count_by_type(list/L, type)
|
||||
var/i = 0
|
||||
for(var/T in L)
|
||||
if(istype(T, type))
|
||||
i++
|
||||
return i
|
||||
|
||||
/proc/find_record(field, value, list/L)
|
||||
for(var/datum/data/record/R in L)
|
||||
if(R.fields[field] == value)
|
||||
return R
|
||||
|
||||
|
||||
//Move a single element from position fromIndex within a list, to position toIndex
|
||||
//All elements in the range [1,toIndex) before the move will be before the pivot afterwards
|
||||
//All elements in the range [toIndex, L.len+1) before the move will be after the pivot afterwards
|
||||
//In other words, it's as if the range [fromIndex,toIndex) have been rotated using a <<< operation common to other languages.
|
||||
//fromIndex and toIndex must be in the range [1,L.len+1]
|
||||
//This will preserve associations ~Carnie
|
||||
/proc/moveElement(list/L, fromIndex, toIndex)
|
||||
if(fromIndex == toIndex || fromIndex+1 == toIndex) //no need to move
|
||||
return
|
||||
if(fromIndex > toIndex)
|
||||
++fromIndex //since a null will be inserted before fromIndex, the index needs to be nudged right by one
|
||||
|
||||
L.Insert(toIndex, null)
|
||||
L.Swap(fromIndex, toIndex)
|
||||
L.Cut(fromIndex, fromIndex+1)
|
||||
|
||||
|
||||
//Move elements [fromIndex,fromIndex+len) to [toIndex-len, toIndex)
|
||||
//Same as moveElement but for ranges of elements
|
||||
//This will preserve associations ~Carnie
|
||||
/proc/moveRange(list/L, fromIndex, toIndex, len=1)
|
||||
var/distance = abs(toIndex - fromIndex)
|
||||
if(len >= distance) //there are more elements to be moved than the distance to be moved. Therefore the same result can be achieved (with fewer operations) by moving elements between where we are and where we are going. The result being, our range we are moving is shifted left or right by dist elements
|
||||
if(fromIndex <= toIndex)
|
||||
return //no need to move
|
||||
fromIndex += len //we want to shift left instead of right
|
||||
|
||||
for(var/i=0, i<distance, ++i)
|
||||
L.Insert(fromIndex, null)
|
||||
L.Swap(fromIndex, toIndex)
|
||||
L.Cut(toIndex, toIndex+1)
|
||||
else
|
||||
if(fromIndex > toIndex)
|
||||
fromIndex += len
|
||||
|
||||
for(var/i=0, i<len, ++i)
|
||||
L.Insert(toIndex, null)
|
||||
L.Swap(fromIndex, toIndex)
|
||||
L.Cut(fromIndex, fromIndex+1)
|
||||
|
||||
//Move elements from [fromIndex, fromIndex+len) to [toIndex, toIndex+len)
|
||||
//Move any elements being overwritten by the move to the now-empty elements, preserving order
|
||||
//Note: if the two ranges overlap, only the destination order will be preserved fully, since some elements will be within both ranges ~Carnie
|
||||
/proc/swapRange(list/L, fromIndex, toIndex, len=1)
|
||||
var/distance = abs(toIndex - fromIndex)
|
||||
if(len > distance) //there is an overlap, therefore swapping each element will require more swaps than inserting new elements
|
||||
if(fromIndex < toIndex)
|
||||
toIndex += len
|
||||
else
|
||||
fromIndex += len
|
||||
|
||||
for(var/i=0, i<distance, ++i)
|
||||
L.Insert(fromIndex, null)
|
||||
L.Swap(fromIndex, toIndex)
|
||||
L.Cut(toIndex, toIndex+1)
|
||||
else
|
||||
if(toIndex > fromIndex)
|
||||
var/a = toIndex
|
||||
toIndex = fromIndex
|
||||
fromIndex = a
|
||||
|
||||
for(var/i=0, i<len, ++i)
|
||||
L.Swap(fromIndex++, toIndex++)
|
||||
|
||||
//replaces reverseList ~Carnie
|
||||
/proc/reverseRange(list/L, start=1, end=0)
|
||||
if(L.len)
|
||||
start = start % L.len
|
||||
end = end % (L.len+1)
|
||||
if(start <= 0)
|
||||
start += L.len
|
||||
if(end <= 0)
|
||||
end += L.len + 1
|
||||
|
||||
--end
|
||||
while(start < end)
|
||||
L.Swap(start++,end--)
|
||||
|
||||
return L
|
||||
|
||||
|
||||
//return first thing in L which has var/varname == value
|
||||
//this is typecaste as list/L, but you could actually feed it an atom instead.
|
||||
//completely safe to use
|
||||
/proc/getElementByVar(list/L, varname, value)
|
||||
varname = "[varname]"
|
||||
for(var/datum/D in L)
|
||||
if(D.vars.Find(varname))
|
||||
if(D.vars[varname] == value)
|
||||
return D
|
||||
|
||||
//remove all nulls from a list
|
||||
/proc/removeNullsFromList(list/L)
|
||||
while(L.Remove(null))
|
||||
continue
|
||||
return L
|
||||
|
||||
//Copies a list, and all lists inside it recusively
|
||||
//Does not copy any other reference type
|
||||
/proc/deepCopyList(list/l)
|
||||
if(!islist(l))
|
||||
return l
|
||||
. = l.Copy()
|
||||
for(var/i = 1 to l.len)
|
||||
if(islist(.[i]))
|
||||
.[i] = .(.[i])
|
||||
|
||||
//takes an input_key, as text, and the list of keys already used, outputting a replacement key in the format of "[input_key] ([number_of_duplicates])" if it finds a duplicate
|
||||
//use this for lists of things that might have the same name, like mobs or objects, that you plan on giving to a player as input
|
||||
/proc/avoid_assoc_duplicate_keys(input_key, list/used_key_list)
|
||||
if(!input_key || !istype(used_key_list))
|
||||
return
|
||||
if(used_key_list[input_key])
|
||||
used_key_list[input_key]++
|
||||
input_key = "[input_key] ([used_key_list[input_key]])"
|
||||
else
|
||||
used_key_list[input_key] = 1
|
||||
return input_key
|
||||
|
||||
#if DM_VERSION > 512
|
||||
#error Remie said that lummox was adding a way to get a lists
|
||||
#error contents via list.values, if that is true remove this
|
||||
#error otherwise, update the version and bug lummox
|
||||
#elseif
|
||||
//Flattens a keyed list into a list of it's contents
|
||||
/proc/flatten_list(list/key_list)
|
||||
if(!islist(key_list))
|
||||
return null
|
||||
. = list()
|
||||
for(var/key in key_list)
|
||||
. |= key_list[key]
|
||||
|
||||
//Picks from the list, with some safeties, and returns the "default" arg if it fails
|
||||
#define DEFAULTPICK(L, default) ((istype(L, /list) && L:len) ? pick(L) : default)
|
||||
|
||||
#define LAZYINITLIST(L) if (!L) L = list()
|
||||
|
||||
#define UNSETEMPTY(L) if (L && !L.len) L = null
|
||||
#define LAZYREMOVE(L, I) if(L) { L -= I; if(!L.len) { L = null; } }
|
||||
#define LAZYADD(L, I) if(!L) { L = list(); } L += I;
|
||||
#define LAZYACCESS(L, I) (L ? (isnum(I) ? (I > 0 && I <= L.len ? L[I] : null) : L[I]) : null)
|
||||
#define LAZYLEN(L) length(L)
|
||||
#define LAZYCLEARLIST(L) if(L) L.Cut()
|
||||
#define SANITIZE_LIST(L) ( islist(L) ? L : list() )
|
||||
|
||||
/* Definining a counter as a series of key -> numeric value entries
|
||||
|
||||
* All these procs modify in place.
|
||||
*/
|
||||
|
||||
/proc/counterlist_scale(list/L, scalar)
|
||||
var/list/out = list()
|
||||
for(var/key in L)
|
||||
out[key] = L[key] * scalar
|
||||
. = out
|
||||
|
||||
/proc/counterlist_sum(list/L)
|
||||
. = 0
|
||||
for(var/key in L)
|
||||
. += L[key]
|
||||
|
||||
/proc/counterlist_normalise(list/L)
|
||||
var/avg = counterlist_sum(L)
|
||||
if(avg != 0)
|
||||
. = counterlist_scale(L, 1 / avg)
|
||||
else
|
||||
. = L
|
||||
|
||||
/proc/counterlist_combine(list/L1, list/L2)
|
||||
for(var/key in L2)
|
||||
var/other_value = L2[key]
|
||||
if(key in L1)
|
||||
L1[key] += other_value
|
||||
else
|
||||
L1[key] = other_value
|
||||
|
||||
/* Definining a counter as a series of key -> numeric value entries
|
||||
|
||||
* All these procs modify in place.
|
||||
*/
|
||||
|
||||
/proc/counterlist_scale(list/L, scalar)
|
||||
var/list/out = list()
|
||||
for(var/key in L)
|
||||
out[key] = L[key] * scalar
|
||||
. = out
|
||||
|
||||
/proc/counterlist_sum(list/L)
|
||||
. = 0
|
||||
for(var/key in L)
|
||||
. += L[key]
|
||||
|
||||
/proc/counterlist_normalise(list/L)
|
||||
var/avg = counterlist_sum(L)
|
||||
if(avg != 0)
|
||||
. = counterlist_scale(L, 1 / avg)
|
||||
else
|
||||
. = L
|
||||
|
||||
/proc/counterlist_combine(list/L1, list/L2)
|
||||
for(var/key in L2)
|
||||
var/other_value = L2[key]
|
||||
if(key in L1)
|
||||
L1[key] += other_value
|
||||
else
|
||||
L1[key] = other_value
|
||||
|
||||
+552
-535
File diff suppressed because it is too large
Load Diff
@@ -24,7 +24,6 @@
|
||||
//doesn't have an object argument because this is "Stacking" with the animate call above
|
||||
//3 billion% intentional
|
||||
|
||||
|
||||
//Dumps the matrix data in format a-f
|
||||
/matrix/proc/tolist()
|
||||
. = list()
|
||||
|
||||
@@ -340,6 +340,20 @@ Proc for attack log creation, because really why not
|
||||
qdel(progbar)
|
||||
|
||||
|
||||
//some additional checks as a callback for for do_afters that want to break on losing health or on the mob taking action
|
||||
/mob/proc/break_do_after_checks(list/checked_health, check_clicks)
|
||||
if(check_clicks && next_move > world.time)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//pass a list in the format list("health" = mob's health var) to check health during this
|
||||
/mob/living/break_do_after_checks(list/checked_health, check_clicks)
|
||||
if(islist(checked_health))
|
||||
if(health < checked_health["health"])
|
||||
return FALSE
|
||||
checked_health["health"] = health
|
||||
return ..()
|
||||
|
||||
/proc/do_after(mob/user, delay, needhand = 1, atom/target = null, progress = 1, datum/callback/extra_checks = null)
|
||||
if(!user)
|
||||
return 0
|
||||
|
||||
@@ -1399,3 +1399,20 @@ GLOBAL_PROTECT(valid_HTTPSGet)
|
||||
|
||||
/proc/pass()
|
||||
return
|
||||
|
||||
/proc/get_mob_or_brainmob(occupant)
|
||||
var/mob/living/mob_occupant
|
||||
|
||||
if(isliving(occupant))
|
||||
mob_occupant = occupant
|
||||
|
||||
else if(isbodypart(occupant))
|
||||
var/obj/item/bodypart/head/head = occupant
|
||||
|
||||
mob_occupant = head.brainmob
|
||||
|
||||
else if(isorgan(occupant))
|
||||
var/obj/item/organ/brain/brain = occupant
|
||||
mob_occupant = brain.brainmob
|
||||
|
||||
return mob_occupant
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
//MINOR TWEAKS/MISC
|
||||
#define AGE_MIN 17 //youngest a character can be
|
||||
#define AGE_MAX 85 //oldest a character can be
|
||||
#define WIZARD_AGE_MIN 30 //youngest a wizard can be
|
||||
#define SHOES_SLOWDOWN 0 //How much shoes slow you down by default. Negative values speed you up
|
||||
#define POCKET_STRIP_DELAY 40 //time taken (in deciseconds) to search somebody's pockets
|
||||
#define DOOR_CRUSH_DAMAGE 15 //the amount of damage that airlocks deal when they crush you
|
||||
|
||||
@@ -3,3 +3,15 @@ GLOBAL_VAR_INIT(secret_force_mode, "secret") // if this is anything but "secret"
|
||||
|
||||
GLOBAL_VAR_INIT(wavesecret, 0) // meteor mode, delays wave progression, terrible name
|
||||
GLOBAL_DATUM(start_state, /datum/station_state) // Used in round-end report
|
||||
|
||||
// Cult, needs to be global so admin cultists are functional
|
||||
GLOBAL_VAR_INIT(blood_target, null) // Cult Master's target or Construct's Master
|
||||
GLOBAL_DATUM(blood_target_image, /image)
|
||||
GLOBAL_VAR_INIT(blood_target_reset_timer, null)
|
||||
GLOBAL_DATUM(sac_mind, /datum/mind)
|
||||
GLOBAL_VAR_INIT(sac_image, null)
|
||||
GLOBAL_VAR_INIT(cult_vote_called, FALSE)
|
||||
GLOBAL_VAR_INIT(cult_mastered, FALSE)
|
||||
GLOBAL_VAR_INIT(reckoning_complete, FALSE)
|
||||
GLOBAL_VAR_INIT(sac_complete, FALSE)
|
||||
GLOBAL_DATUM(cult_narsie, /obj/singularity/narsie/large/cult)
|
||||
@@ -54,3 +54,4 @@ GLOBAL_LIST_EMPTY(awaydestinations) //a list of landmarks that the warpgate can
|
||||
GLOBAL_LIST_EMPTY(sortedAreas)
|
||||
|
||||
GLOBAL_LIST_EMPTY(transit_markers)
|
||||
GLOBAL_LIST_EMPTY(all_abstract_markers)
|
||||
@@ -19,5 +19,7 @@ GLOBAL_LIST_EMPTY(silicon_mobs) //all silicon mobs
|
||||
GLOBAL_LIST_EMPTY(ai_list)
|
||||
GLOBAL_LIST_EMPTY(pai_list)
|
||||
GLOBAL_LIST_EMPTY(available_ai_shells)
|
||||
GLOBAL_LIST_EMPTY(language_datums)
|
||||
GLOBAL_LIST_EMPTY(simple_animals)
|
||||
GLOBAL_LIST_EMPTY(simple_animals)
|
||||
|
||||
GLOBAL_LIST_EMPTY(language_datum_instances)
|
||||
GLOBAL_LIST_EMPTY(all_languages)
|
||||
|
||||
+101
-80
@@ -92,6 +92,9 @@
|
||||
if(next_move > world.time) // in the year 2000...
|
||||
return
|
||||
|
||||
if(A.IsObscured())
|
||||
return
|
||||
|
||||
if(istype(loc,/obj/mecha))
|
||||
var/obj/mecha/M = loc
|
||||
return M.click_action(A,src,params)
|
||||
@@ -111,108 +114,126 @@
|
||||
W.attack_self(src)
|
||||
update_inv_hands()
|
||||
return
|
||||
|
||||
//These are always reachable.
|
||||
//User itself, current loc, and user inventory
|
||||
if(DirectAccess(A))
|
||||
|
||||
//These are always reachable.
|
||||
//User itself, current loc, and user inventory
|
||||
if(DirectAccess(A))
|
||||
if(W)
|
||||
melee_item_attack_chain(src,W,A,params)
|
||||
melee_item_attack_chain(src,W,A,params)
|
||||
else
|
||||
if(ismob(A))
|
||||
changeNext_move(CLICK_CD_MELEE)
|
||||
UnarmedAttack(A)
|
||||
return
|
||||
|
||||
//Can't reach anything else in lockers or other weirdness
|
||||
if(!loc.AllowClick())
|
||||
|
||||
//Can't reach anything else in lockers or other weirdness
|
||||
if(!loc.AllowClick())
|
||||
return
|
||||
|
||||
//Standard reach turf to turf or reaching inside storage
|
||||
if(CanReach(A,W))
|
||||
if(W)
|
||||
melee_item_attack_chain(src,W,A,params)
|
||||
else
|
||||
if(ismob(A))
|
||||
changeNext_move(CLICK_CD_MELEE)
|
||||
UnarmedAttack(A,1)
|
||||
else
|
||||
if(W)
|
||||
W.afterattack(A,src,0,params)
|
||||
else
|
||||
RangedAttack(A,params)
|
||||
|
||||
/atom/movable/proc/CanReach(atom/target,obj/item/tool,view_only = FALSE)
|
||||
if(isturf(target) || isturf(target.loc) || DirectAccess(target)) //Directly accessible atoms
|
||||
if(Adjacent(target) || (tool && CheckToolReach(src, target, tool.reach))) //Adjacent or reaching attacks
|
||||
return TRUE
|
||||
else
|
||||
//Things inside storage insde another storage
|
||||
//Eg Contents of a box in a backpack
|
||||
var/atom/outer_storage = get_atom_on_turf(target)
|
||||
if(outer_storage == target) //whatever that is we don't want infinite loop.
|
||||
return FALSE
|
||||
if(outer_storage && CanReach(outer_storage,tool) && outer_storage.CanReachStorage(target,src,view_only ? STORAGE_VIEW_DEPTH : INVENTORY_DEPTH))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
//Can [target] in this container be reached by [user], can't be more than [depth] levels deep
|
||||
/atom/proc/CanReachStorage(atom/target,user,depth)
|
||||
return FALSE
|
||||
|
||||
/obj/item/weapon/storage/CanReachStorage(atom/target,user,depth)
|
||||
while(target && depth > 0)
|
||||
target = target.loc
|
||||
depth--
|
||||
if(target == src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/atom/movable/proc/DirectAccess(atom/target)
|
||||
if(target == src)
|
||||
return TRUE
|
||||
if(target == loc)
|
||||
return TRUE
|
||||
|
||||
/mob/DirectAccess(atom/target)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(target in contents) //This could probably use moving down and restricting to inventory only
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/living/DirectAccess(atom/target)
|
||||
if(..()) //Lightweight checks first
|
||||
return TRUE
|
||||
if(target in GetAllContents())
|
||||
return TRUE
|
||||
|
||||
/atom/proc/AllowClick()
|
||||
return FALSE
|
||||
|
||||
/turf/AllowClick()
|
||||
return TRUE
|
||||
//Standard reach turf to turf or reaching inside storage
|
||||
if(CanReach(A,W))
|
||||
if(W)
|
||||
melee_item_attack_chain(src,W,A,params)
|
||||
else
|
||||
if(ismob(A))
|
||||
changeNext_move(CLICK_CD_MELEE)
|
||||
UnarmedAttack(A,1)
|
||||
else
|
||||
if(W)
|
||||
W.afterattack(A,src,0,params)
|
||||
else
|
||||
RangedAttack(A,params)
|
||||
|
||||
/proc/CheckToolReach(atom/movable/here, atom/movable/there, reach)
|
||||
//Is the atom obscured by a PREVENT_CLICK_UNDER object above it
|
||||
/atom/proc/IsObscured()
|
||||
if(!isturf(loc)) //This only makes sense for things directly on turfs for now
|
||||
return FALSE
|
||||
var/turf/T = get_turf_pixel(src)
|
||||
if(!T)
|
||||
return FALSE
|
||||
for(var/atom/movable/AM in T)
|
||||
if(AM.flags & PREVENT_CLICK_UNDER && AM.density && AM.layer > layer)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/turf/IsObscured()
|
||||
for(var/atom/movable/AM in src)
|
||||
if(AM.flags & PREVENT_CLICK_UNDER && AM.density)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/atom/movable/proc/CanReach(atom/target,obj/item/tool,view_only = FALSE)
|
||||
if(isturf(target) || isturf(target.loc) || DirectAccess(target)) //Directly accessible atoms
|
||||
if(Adjacent(target) || (tool && CheckToolReach(src, target, tool.reach))) //Adjacent or reaching attacks
|
||||
return TRUE
|
||||
else
|
||||
//Things inside storage insde another storage
|
||||
//Eg Contents of a box in a backpack
|
||||
var/atom/outer_storage = get_atom_on_turf(target)
|
||||
if(outer_storage == target) //whatever that is we don't want infinite loop.
|
||||
return FALSE
|
||||
if(outer_storage && CanReach(outer_storage,tool) && outer_storage.CanReachStorage(target,src,view_only ? STORAGE_VIEW_DEPTH : INVENTORY_DEPTH))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
//Can [target] in this container be reached by [user], can't be more than [depth] levels deep
|
||||
/atom/proc/CanReachStorage(atom/target,user,depth)
|
||||
return FALSE
|
||||
|
||||
/obj/item/weapon/storage/CanReachStorage(atom/target,user,depth)
|
||||
while(target && depth > 0)
|
||||
target = target.loc
|
||||
depth--
|
||||
if(target == src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/atom/movable/proc/DirectAccess(atom/target)
|
||||
if(target == src)
|
||||
return TRUE
|
||||
if(target == loc)
|
||||
return TRUE
|
||||
|
||||
/mob/DirectAccess(atom/target)
|
||||
if(..())
|
||||
return TRUE
|
||||
if(target in contents) //This could probably use moving down and restricting to inventory only
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/living/DirectAccess(atom/target)
|
||||
if(..()) //Lightweight checks first
|
||||
return TRUE
|
||||
if(target in GetAllContents())
|
||||
return TRUE
|
||||
|
||||
/atom/proc/AllowClick()
|
||||
return FALSE
|
||||
|
||||
/turf/AllowClick()
|
||||
return TRUE
|
||||
|
||||
/proc/CheckToolReach(atom/movable/here, atom/movable/there, reach)
|
||||
if(!here || !there)
|
||||
return
|
||||
switch(reach)
|
||||
if(0)
|
||||
return FALSE
|
||||
return FALSE
|
||||
if(1)
|
||||
return FALSE //here.Adjacent(there)
|
||||
return FALSE //here.Adjacent(there)
|
||||
if(2 to INFINITY)
|
||||
var/obj/dummy = new(get_turf(here))
|
||||
var/obj/dummy = new(get_turf(here))
|
||||
dummy.pass_flags |= PASSTABLE
|
||||
dummy.invisibility = INVISIBILITY_ABSTRACT
|
||||
dummy.invisibility = INVISIBILITY_ABSTRACT
|
||||
for(var/i in 1 to reach) //Limit it to that many tries
|
||||
var/turf/T = get_step(dummy, get_dir(dummy, there))
|
||||
if(dummy.CanReach(there))
|
||||
if(dummy.CanReach(there))
|
||||
qdel(dummy)
|
||||
return TRUE
|
||||
return TRUE
|
||||
if(!dummy.Move(T)) //we're blocked!
|
||||
qdel(dummy)
|
||||
return
|
||||
qdel(dummy)
|
||||
qdel(dummy)
|
||||
|
||||
// Default behavior: ignore double clicks (the second click that makes the doubleclick call already calls for a normal click)
|
||||
/mob/proc/DblClickOn(atom/A, params)
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
thealert.override_alerts = override
|
||||
if(override)
|
||||
thealert.timeout = null
|
||||
thealert.mob_viewer = src
|
||||
|
||||
if(new_master)
|
||||
var/old_layer = new_master.layer
|
||||
@@ -96,6 +97,7 @@
|
||||
var/severity = 0
|
||||
var/alerttooltipstyle = ""
|
||||
var/override_alerts = FALSE //If it is overriding other alerts of the same type
|
||||
var/mob/mob_viewer //the mob viewing this alert
|
||||
|
||||
|
||||
/obj/screen/alert/MouseEntered(location,control,params)
|
||||
@@ -256,6 +258,102 @@ or shoot a gun to move around via Newton's 3rd Law of Motion."
|
||||
icon_state = "blobbernaut_nofactory"
|
||||
alerttooltipstyle = "blob"
|
||||
|
||||
// BLOODCULT
|
||||
|
||||
/obj/screen/alert/bloodsense
|
||||
name = "Blood Sense"
|
||||
desc = "Allows you to sense blood that is manipulated by dark magicks."
|
||||
icon_state = "cult_sense"
|
||||
alerttooltipstyle = "cult"
|
||||
var/static/image/narnar
|
||||
var/angle = 0
|
||||
var/mob/living/simple_animal/hostile/construct/Cviewer = null
|
||||
|
||||
/obj/screen/alert/bloodsense/Initialize()
|
||||
. = ..()
|
||||
if(!narnar)
|
||||
narnar = new('icons/mob/screen_alert.dmi', "mini_nar")
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
|
||||
/obj/screen/alert/bloodsense/Destroy()
|
||||
Cviewer = null
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
return ..()
|
||||
|
||||
/obj/screen/alert/bloodsense/process()
|
||||
var/atom/blood_target
|
||||
if(GLOB.blood_target)
|
||||
if(!get_turf(GLOB.blood_target))
|
||||
GLOB.blood_target = null
|
||||
else
|
||||
blood_target = GLOB.blood_target
|
||||
if(Cviewer && Cviewer.seeking && Cviewer.master)
|
||||
blood_target = Cviewer.master
|
||||
desc = "Your blood sense is leading you to [Cviewer.master]"
|
||||
if(!blood_target)
|
||||
if(!GLOB.sac_complete)
|
||||
if(icon_state == "runed_sense0")
|
||||
return
|
||||
animate(src, transform = null, time = 1, loop = 0)
|
||||
angle = 0
|
||||
cut_overlays()
|
||||
icon_state = "runed_sense0"
|
||||
desc = "Nar-Sie demands that [GLOB.sac_mind] be sacrificed before the summoning ritual can begin."
|
||||
add_overlay(GLOB.sac_image)
|
||||
else
|
||||
if(icon_state == "runed_sense1")
|
||||
return
|
||||
animate(src, transform = null, time = 1, loop = 0)
|
||||
angle = 0
|
||||
cut_overlays()
|
||||
icon_state = "runed_sense1"
|
||||
desc = "The sacrifice is complete, bring the wrath of Nar-Sie upon the crew!"
|
||||
add_overlay(narnar)
|
||||
return
|
||||
var/turf/P = get_turf(blood_target)
|
||||
var/turf/Q = get_turf(mob_viewer)
|
||||
var/area/A = get_area(P)
|
||||
if(P.z != Q.z) //The target is on a different Z level, we cannot sense that far.
|
||||
icon_state = "runed_sense2"
|
||||
desc = "[blood_target] is no longer in your sector, you cannot sense its presence here."
|
||||
return
|
||||
desc = "You are currently tracking [blood_target] in [A.name]."
|
||||
var/target_angle = Get_Angle(Q, P)
|
||||
var/target_dist = get_dist(P, Q)
|
||||
cut_overlays()
|
||||
switch(target_dist)
|
||||
if(0 to 1)
|
||||
icon_state = "runed_sense2"
|
||||
if(2 to 8)
|
||||
icon_state = "arrow8"
|
||||
if(9 to 15)
|
||||
icon_state = "arrow7"
|
||||
if(16 to 22)
|
||||
icon_state = "arrow6"
|
||||
if(23 to 29)
|
||||
icon_state = "arrow5"
|
||||
if(30 to 36)
|
||||
icon_state = "arrow4"
|
||||
if(37 to 43)
|
||||
icon_state = "arrow3"
|
||||
if(44 to 50)
|
||||
icon_state = "arrow2"
|
||||
if(51 to 57)
|
||||
icon_state = "arrow1"
|
||||
if(58 to 64)
|
||||
icon_state = "arrow0"
|
||||
if(65 to 400)
|
||||
icon_state = "arrow"
|
||||
var/difference = target_angle - angle
|
||||
angle = target_angle
|
||||
if(!difference)
|
||||
return
|
||||
var/matrix/final = matrix(transform)
|
||||
final.Turn(difference)
|
||||
animate(src, transform = final, time = 5, loop = 0)
|
||||
|
||||
|
||||
|
||||
// CLOCKCULT
|
||||
/obj/screen/alert/clockwork
|
||||
alerttooltipstyle = "clockcult"
|
||||
@@ -605,4 +703,3 @@ so as to remain in compliance with the most up-to-date laws."
|
||||
severity = 0
|
||||
master = null
|
||||
screen_loc = ""
|
||||
|
||||
|
||||
@@ -68,6 +68,10 @@
|
||||
using.screen_loc = ui_ghost_pai
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/language_menu
|
||||
using.icon = ui_style
|
||||
static_inventory += using
|
||||
|
||||
/datum/hud/ghost/show_hud(version = 0, mob/viewmob)
|
||||
..()
|
||||
if(!mymob.client.prefs.ghost_hud)
|
||||
|
||||
+267
-267
@@ -1,270 +1,270 @@
|
||||
/*
|
||||
The hud datum
|
||||
Used to show and hide huds for all the different mob types,
|
||||
including inventories and item quick actions.
|
||||
*/
|
||||
|
||||
/datum/hud
|
||||
var/mob/mymob
|
||||
|
||||
var/hud_shown = 1 //Used for the HUD toggle (F12)
|
||||
var/hud_version = 1 //Current displayed version of the HUD
|
||||
var/inventory_shown = 0 //Equipped item inventory
|
||||
var/show_intent_icons = 0
|
||||
var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
|
||||
|
||||
var/obj/screen/ling/chems/lingchemdisplay
|
||||
var/obj/screen/ling/sting/lingstingdisplay
|
||||
|
||||
var/obj/screen/blobpwrdisplay
|
||||
|
||||
var/obj/screen/alien_plasma_display
|
||||
var/obj/screen/alien_queen_finder
|
||||
|
||||
var/obj/screen/devil/soul_counter/devilsouldisplay
|
||||
|
||||
var/obj/screen/deity_power_display
|
||||
var/obj/screen/deity_follower_display
|
||||
|
||||
var/obj/screen/nightvisionicon
|
||||
var/obj/screen/action_intent
|
||||
var/obj/screen/zone_select
|
||||
var/obj/screen/pull_icon
|
||||
var/obj/screen/throw_icon
|
||||
var/obj/screen/module_store_icon
|
||||
|
||||
var/list/static_inventory = list() //the screen objects which are static
|
||||
var/list/toggleable_inventory = list() //the screen objects which can be hidden
|
||||
var/list/obj/screen/hotkeybuttons = list() //the buttons that can be used via hotkeys
|
||||
var/list/infodisplay = list() //the screen objects that display mob info (health, alien plasma, etc...)
|
||||
var/list/screenoverlays = list() //the screen objects used as whole screen overlays (flash, damageoverlay, etc...)
|
||||
var/list/inv_slots[slots_amt] // /obj/screen/inventory objects, ordered by their slot ID.
|
||||
var/list/hand_slots // /obj/screen/inventory/hand objects, assoc list of "[held_index]" = object
|
||||
var/list/obj/screen/plane_master/plane_masters = list() // see "appearance_flags" in the ref, assoc list of "[plane]" = object
|
||||
|
||||
var/obj/screen/movable/action_button/hide_toggle/hide_actions_toggle
|
||||
var/action_buttons_hidden = 0
|
||||
|
||||
var/obj/screen/healths
|
||||
var/obj/screen/healthdoll
|
||||
var/obj/screen/internals
|
||||
|
||||
var/ui_style_icon = 'icons/mob/screen_midnight.dmi'
|
||||
|
||||
/datum/hud/New(mob/owner , ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
mymob = owner
|
||||
|
||||
ui_style_icon = ui_style
|
||||
|
||||
hide_actions_toggle = new
|
||||
hide_actions_toggle.InitialiseIcon(src)
|
||||
|
||||
hand_slots = list()
|
||||
|
||||
for(var/mytype in subtypesof(/obj/screen/plane_master))
|
||||
var/obj/screen/plane_master/instance = new mytype()
|
||||
plane_masters["[instance.plane]"] = instance
|
||||
instance.backdrop(mymob)
|
||||
|
||||
/datum/hud/Destroy()
|
||||
if(mymob.hud_used == src)
|
||||
mymob.hud_used = null
|
||||
|
||||
qdel(hide_actions_toggle)
|
||||
hide_actions_toggle = null
|
||||
|
||||
qdel(module_store_icon)
|
||||
module_store_icon = null
|
||||
|
||||
if(static_inventory.len)
|
||||
for(var/thing in static_inventory)
|
||||
qdel(thing)
|
||||
static_inventory.Cut()
|
||||
|
||||
inv_slots.Cut()
|
||||
action_intent = null
|
||||
zone_select = null
|
||||
pull_icon = null
|
||||
|
||||
if(toggleable_inventory.len)
|
||||
for(var/thing in toggleable_inventory)
|
||||
qdel(thing)
|
||||
toggleable_inventory.Cut()
|
||||
|
||||
if(hotkeybuttons.len)
|
||||
for(var/thing in hotkeybuttons)
|
||||
qdel(thing)
|
||||
hotkeybuttons.Cut()
|
||||
|
||||
throw_icon = null
|
||||
|
||||
if(infodisplay.len)
|
||||
for(var/thing in infodisplay)
|
||||
qdel(thing)
|
||||
infodisplay.Cut()
|
||||
|
||||
healths = null
|
||||
healthdoll = null
|
||||
internals = null
|
||||
lingchemdisplay = null
|
||||
devilsouldisplay = null
|
||||
lingstingdisplay = null
|
||||
blobpwrdisplay = null
|
||||
alien_plasma_display = null
|
||||
alien_queen_finder = null
|
||||
deity_power_display = null
|
||||
deity_follower_display = null
|
||||
nightvisionicon = null
|
||||
|
||||
if(plane_masters.len)
|
||||
for(var/thing in plane_masters)
|
||||
qdel(plane_masters[thing])
|
||||
plane_masters.Cut()
|
||||
|
||||
if(screenoverlays.len)
|
||||
for(var/thing in screenoverlays)
|
||||
qdel(thing)
|
||||
screenoverlays.Cut()
|
||||
mymob = null
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/proc/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
hud_used = new /datum/hud(src)
|
||||
update_sight()
|
||||
|
||||
//Version denotes which style should be displayed. blank or 0 means "next version"
|
||||
/datum/hud/proc/show_hud(version = 0,mob/viewmob)
|
||||
if(!ismob(mymob))
|
||||
return 0
|
||||
var/mob/screenmob = viewmob || mymob
|
||||
if(!screenmob.client)
|
||||
return 0
|
||||
|
||||
screenmob.client.screen = list()
|
||||
|
||||
var/display_hud_version = version
|
||||
if(!display_hud_version) //If 0 or blank, display the next hud version
|
||||
display_hud_version = hud_version + 1
|
||||
if(display_hud_version > HUD_VERSIONS) //If the requested version number is greater than the available versions, reset back to the first version
|
||||
display_hud_version = 1
|
||||
|
||||
switch(display_hud_version)
|
||||
if(HUD_STYLE_STANDARD) //Default HUD
|
||||
hud_shown = 1 //Governs behavior of other procs
|
||||
if(static_inventory.len)
|
||||
screenmob.client.screen += static_inventory
|
||||
if(toggleable_inventory.len && screenmob.hud_used && screenmob.hud_used.inventory_shown)
|
||||
screenmob.client.screen += toggleable_inventory
|
||||
if(hotkeybuttons.len && !hotkey_ui_hidden)
|
||||
screenmob.client.screen += hotkeybuttons
|
||||
if(infodisplay.len)
|
||||
screenmob.client.screen += infodisplay
|
||||
|
||||
screenmob.client.screen += hide_actions_toggle
|
||||
|
||||
if(action_intent)
|
||||
action_intent.screen_loc = initial(action_intent.screen_loc) //Restore intent selection to the original position
|
||||
|
||||
if(HUD_STYLE_REDUCED) //Reduced HUD
|
||||
hud_shown = 0 //Governs behavior of other procs
|
||||
if(static_inventory.len)
|
||||
screenmob.client.screen -= static_inventory
|
||||
if(toggleable_inventory.len)
|
||||
screenmob.client.screen -= toggleable_inventory
|
||||
if(hotkeybuttons.len)
|
||||
screenmob.client.screen -= hotkeybuttons
|
||||
if(infodisplay.len)
|
||||
screenmob.client.screen += infodisplay
|
||||
|
||||
//These ones are a part of 'static_inventory', 'toggleable_inventory' or 'hotkeybuttons' but we want them to stay
|
||||
for(var/h in hand_slots)
|
||||
var/obj/screen/hand = hand_slots[h]
|
||||
if(hand)
|
||||
screenmob.client.screen += hand
|
||||
if(action_intent)
|
||||
screenmob.client.screen += action_intent //we want the intent switcher visible
|
||||
action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
||||
|
||||
if(HUD_STYLE_NOHUD) //No HUD
|
||||
hud_shown = 0 //Governs behavior of other procs
|
||||
if(static_inventory.len)
|
||||
screenmob.client.screen -= static_inventory
|
||||
if(toggleable_inventory.len)
|
||||
screenmob.client.screen -= toggleable_inventory
|
||||
if(hotkeybuttons.len)
|
||||
screenmob.client.screen -= hotkeybuttons
|
||||
if(infodisplay.len)
|
||||
screenmob.client.screen -= infodisplay
|
||||
|
||||
for(var/thing in plane_masters)
|
||||
screenmob.client.screen += plane_masters[thing]
|
||||
|
||||
hud_version = display_hud_version
|
||||
persistent_inventory_update(screenmob)
|
||||
mymob.update_action_buttons(1)
|
||||
reorganize_alerts()
|
||||
mymob.reload_fullscreen()
|
||||
update_parallax_pref(screenmob)
|
||||
|
||||
/datum/hud/human/show_hud(version = 0,mob/viewmob)
|
||||
..()
|
||||
hidden_inventory_update(viewmob)
|
||||
|
||||
/datum/hud/robot/show_hud(version = 0, mob/viewmob)
|
||||
..()
|
||||
update_robot_modules_display()
|
||||
|
||||
/datum/hud/proc/hidden_inventory_update()
|
||||
return
|
||||
|
||||
/datum/hud/proc/persistent_inventory_update(mob/viewer)
|
||||
if(!mymob)
|
||||
return
|
||||
|
||||
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
|
||||
/mob/verb/button_pressed_F12()
|
||||
set name = "F12"
|
||||
set hidden = 1
|
||||
|
||||
if(hud_used && client)
|
||||
hud_used.show_hud() //Shows the next hud preset
|
||||
to_chat(usr, "<span class ='info'>Switched HUD mode. Press F12 to toggle.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class ='warning'>This mob type does not use a HUD.</span>")
|
||||
|
||||
|
||||
//(re)builds the hand ui slots, throwing away old ones
|
||||
//not really worth jugglying existing ones so we just scrap+rebuild
|
||||
//9/10 this is only called once per mob and only for 2 hands
|
||||
/datum/hud/proc/build_hand_slots(ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
for(var/h in hand_slots)
|
||||
var/obj/screen/inventory/hand/H = hand_slots[h]
|
||||
if(H)
|
||||
static_inventory -= H
|
||||
hand_slots = list()
|
||||
var/obj/screen/inventory/hand/hand_box
|
||||
for(var/i in 1 to mymob.held_items.len)
|
||||
hand_box = new /obj/screen/inventory/hand()
|
||||
hand_box.name = mymob.get_held_index_name(i)
|
||||
hand_box.icon = ui_style
|
||||
hand_box.icon_state = "hand_[mymob.held_index_to_dir(i)]"
|
||||
hand_box.screen_loc = ui_hand_position(i)
|
||||
hand_box.held_index = i
|
||||
hand_slots["[i]"] = hand_box
|
||||
hand_box.hud = src
|
||||
static_inventory += hand_box
|
||||
hand_box.update_icon()
|
||||
|
||||
var/i = 1
|
||||
for(var/obj/screen/swap_hand/SH in static_inventory)
|
||||
SH.screen_loc = ui_swaphand_position(mymob,!(i % 2) ? 2: 1)
|
||||
i++
|
||||
for(var/obj/screen/human/equip/E in static_inventory)
|
||||
E.screen_loc = ui_equip_position(mymob)
|
||||
if(mymob.hud_used)
|
||||
show_hud(HUD_STYLE_STANDARD,mymob)
|
||||
/*
|
||||
The hud datum
|
||||
Used to show and hide huds for all the different mob types,
|
||||
including inventories and item quick actions.
|
||||
*/
|
||||
|
||||
/datum/hud
|
||||
var/mob/mymob
|
||||
|
||||
var/hud_shown = 1 //Used for the HUD toggle (F12)
|
||||
var/hud_version = 1 //Current displayed version of the HUD
|
||||
var/inventory_shown = 0 //Equipped item inventory
|
||||
var/show_intent_icons = 0
|
||||
var/hotkey_ui_hidden = 0 //This is to hide the buttons that can be used via hotkeys. (hotkeybuttons list of buttons)
|
||||
|
||||
var/obj/screen/ling/chems/lingchemdisplay
|
||||
var/obj/screen/ling/sting/lingstingdisplay
|
||||
|
||||
var/obj/screen/blobpwrdisplay
|
||||
|
||||
var/obj/screen/alien_plasma_display
|
||||
var/obj/screen/alien_queen_finder
|
||||
|
||||
var/obj/screen/devil/soul_counter/devilsouldisplay
|
||||
|
||||
var/obj/screen/deity_power_display
|
||||
var/obj/screen/deity_follower_display
|
||||
|
||||
var/obj/screen/nightvisionicon
|
||||
var/obj/screen/action_intent
|
||||
var/obj/screen/zone_select
|
||||
var/obj/screen/pull_icon
|
||||
var/obj/screen/throw_icon
|
||||
var/obj/screen/module_store_icon
|
||||
|
||||
var/list/static_inventory = list() //the screen objects which are static
|
||||
var/list/toggleable_inventory = list() //the screen objects which can be hidden
|
||||
var/list/obj/screen/hotkeybuttons = list() //the buttons that can be used via hotkeys
|
||||
var/list/infodisplay = list() //the screen objects that display mob info (health, alien plasma, etc...)
|
||||
var/list/screenoverlays = list() //the screen objects used as whole screen overlays (flash, damageoverlay, etc...)
|
||||
var/list/inv_slots[slots_amt] // /obj/screen/inventory objects, ordered by their slot ID.
|
||||
var/list/hand_slots // /obj/screen/inventory/hand objects, assoc list of "[held_index]" = object
|
||||
var/list/obj/screen/plane_master/plane_masters = list() // see "appearance_flags" in the ref, assoc list of "[plane]" = object
|
||||
|
||||
var/obj/screen/movable/action_button/hide_toggle/hide_actions_toggle
|
||||
var/action_buttons_hidden = 0
|
||||
|
||||
var/obj/screen/healths
|
||||
var/obj/screen/healthdoll
|
||||
var/obj/screen/internals
|
||||
|
||||
var/ui_style_icon = 'icons/mob/screen_midnight.dmi'
|
||||
|
||||
/datum/hud/New(mob/owner , ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
mymob = owner
|
||||
|
||||
ui_style_icon = ui_style
|
||||
|
||||
hide_actions_toggle = new
|
||||
hide_actions_toggle.InitialiseIcon(src)
|
||||
|
||||
hand_slots = list()
|
||||
|
||||
for(var/mytype in subtypesof(/obj/screen/plane_master))
|
||||
var/obj/screen/plane_master/instance = new mytype()
|
||||
plane_masters["[instance.plane]"] = instance
|
||||
instance.backdrop(mymob)
|
||||
|
||||
/datum/hud/Destroy()
|
||||
if(mymob.hud_used == src)
|
||||
mymob.hud_used = null
|
||||
|
||||
qdel(hide_actions_toggle)
|
||||
hide_actions_toggle = null
|
||||
|
||||
qdel(module_store_icon)
|
||||
module_store_icon = null
|
||||
|
||||
if(static_inventory.len)
|
||||
for(var/thing in static_inventory)
|
||||
qdel(thing)
|
||||
static_inventory.Cut()
|
||||
|
||||
inv_slots.Cut()
|
||||
action_intent = null
|
||||
zone_select = null
|
||||
pull_icon = null
|
||||
|
||||
if(toggleable_inventory.len)
|
||||
for(var/thing in toggleable_inventory)
|
||||
qdel(thing)
|
||||
toggleable_inventory.Cut()
|
||||
|
||||
if(hotkeybuttons.len)
|
||||
for(var/thing in hotkeybuttons)
|
||||
qdel(thing)
|
||||
hotkeybuttons.Cut()
|
||||
|
||||
throw_icon = null
|
||||
|
||||
if(infodisplay.len)
|
||||
for(var/thing in infodisplay)
|
||||
qdel(thing)
|
||||
infodisplay.Cut()
|
||||
|
||||
healths = null
|
||||
healthdoll = null
|
||||
internals = null
|
||||
lingchemdisplay = null
|
||||
devilsouldisplay = null
|
||||
lingstingdisplay = null
|
||||
blobpwrdisplay = null
|
||||
alien_plasma_display = null
|
||||
alien_queen_finder = null
|
||||
deity_power_display = null
|
||||
deity_follower_display = null
|
||||
nightvisionicon = null
|
||||
|
||||
if(plane_masters.len)
|
||||
for(var/thing in plane_masters)
|
||||
qdel(plane_masters[thing])
|
||||
plane_masters.Cut()
|
||||
|
||||
if(screenoverlays.len)
|
||||
for(var/thing in screenoverlays)
|
||||
qdel(thing)
|
||||
screenoverlays.Cut()
|
||||
mymob = null
|
||||
|
||||
return ..()
|
||||
|
||||
/mob/proc/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
hud_used = new /datum/hud(src)
|
||||
update_sight()
|
||||
|
||||
//Version denotes which style should be displayed. blank or 0 means "next version"
|
||||
/datum/hud/proc/show_hud(version = 0,mob/viewmob)
|
||||
if(!ismob(mymob))
|
||||
return 0
|
||||
var/mob/screenmob = viewmob || mymob
|
||||
if(!screenmob.client)
|
||||
return 0
|
||||
|
||||
screenmob.client.screen = list()
|
||||
|
||||
var/display_hud_version = version
|
||||
if(!display_hud_version) //If 0 or blank, display the next hud version
|
||||
display_hud_version = hud_version + 1
|
||||
if(display_hud_version > HUD_VERSIONS) //If the requested version number is greater than the available versions, reset back to the first version
|
||||
display_hud_version = 1
|
||||
|
||||
switch(display_hud_version)
|
||||
if(HUD_STYLE_STANDARD) //Default HUD
|
||||
hud_shown = 1 //Governs behavior of other procs
|
||||
if(static_inventory.len)
|
||||
screenmob.client.screen += static_inventory
|
||||
if(toggleable_inventory.len && screenmob.hud_used && screenmob.hud_used.inventory_shown)
|
||||
screenmob.client.screen += toggleable_inventory
|
||||
if(hotkeybuttons.len && !hotkey_ui_hidden)
|
||||
screenmob.client.screen += hotkeybuttons
|
||||
if(infodisplay.len)
|
||||
screenmob.client.screen += infodisplay
|
||||
|
||||
screenmob.client.screen += hide_actions_toggle
|
||||
|
||||
if(action_intent)
|
||||
action_intent.screen_loc = initial(action_intent.screen_loc) //Restore intent selection to the original position
|
||||
|
||||
if(HUD_STYLE_REDUCED) //Reduced HUD
|
||||
hud_shown = 0 //Governs behavior of other procs
|
||||
if(static_inventory.len)
|
||||
screenmob.client.screen -= static_inventory
|
||||
if(toggleable_inventory.len)
|
||||
screenmob.client.screen -= toggleable_inventory
|
||||
if(hotkeybuttons.len)
|
||||
screenmob.client.screen -= hotkeybuttons
|
||||
if(infodisplay.len)
|
||||
screenmob.client.screen += infodisplay
|
||||
|
||||
//These ones are a part of 'static_inventory', 'toggleable_inventory' or 'hotkeybuttons' but we want them to stay
|
||||
for(var/h in hand_slots)
|
||||
var/obj/screen/hand = hand_slots[h]
|
||||
if(hand)
|
||||
screenmob.client.screen += hand
|
||||
if(action_intent)
|
||||
screenmob.client.screen += action_intent //we want the intent switcher visible
|
||||
action_intent.screen_loc = ui_acti_alt //move this to the alternative position, where zone_select usually is.
|
||||
|
||||
if(HUD_STYLE_NOHUD) //No HUD
|
||||
hud_shown = 0 //Governs behavior of other procs
|
||||
if(static_inventory.len)
|
||||
screenmob.client.screen -= static_inventory
|
||||
if(toggleable_inventory.len)
|
||||
screenmob.client.screen -= toggleable_inventory
|
||||
if(hotkeybuttons.len)
|
||||
screenmob.client.screen -= hotkeybuttons
|
||||
if(infodisplay.len)
|
||||
screenmob.client.screen -= infodisplay
|
||||
|
||||
for(var/thing in plane_masters)
|
||||
screenmob.client.screen += plane_masters[thing]
|
||||
|
||||
hud_version = display_hud_version
|
||||
persistent_inventory_update(screenmob)
|
||||
mymob.update_action_buttons(1)
|
||||
reorganize_alerts()
|
||||
mymob.reload_fullscreen()
|
||||
update_parallax_pref(screenmob)
|
||||
|
||||
/datum/hud/human/show_hud(version = 0,mob/viewmob)
|
||||
..()
|
||||
hidden_inventory_update(viewmob)
|
||||
|
||||
/datum/hud/robot/show_hud(version = 0, mob/viewmob)
|
||||
..()
|
||||
update_robot_modules_display()
|
||||
|
||||
/datum/hud/proc/hidden_inventory_update()
|
||||
return
|
||||
|
||||
/datum/hud/proc/persistent_inventory_update(mob/viewer)
|
||||
if(!mymob)
|
||||
return
|
||||
|
||||
//Triggered when F12 is pressed (Unless someone changed something in the DMF)
|
||||
/mob/verb/button_pressed_F12()
|
||||
set name = "F12"
|
||||
set hidden = 1
|
||||
|
||||
if(hud_used && client)
|
||||
hud_used.show_hud() //Shows the next hud preset
|
||||
to_chat(usr, "<span class ='info'>Switched HUD mode. Press F12 to toggle.</span>")
|
||||
else
|
||||
to_chat(usr, "<span class ='warning'>This mob type does not use a HUD.</span>")
|
||||
|
||||
|
||||
//(re)builds the hand ui slots, throwing away old ones
|
||||
//not really worth jugglying existing ones so we just scrap+rebuild
|
||||
//9/10 this is only called once per mob and only for 2 hands
|
||||
/datum/hud/proc/build_hand_slots(ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
for(var/h in hand_slots)
|
||||
var/obj/screen/inventory/hand/H = hand_slots[h]
|
||||
if(H)
|
||||
static_inventory -= H
|
||||
hand_slots = list()
|
||||
var/obj/screen/inventory/hand/hand_box
|
||||
for(var/i in 1 to mymob.held_items.len)
|
||||
hand_box = new /obj/screen/inventory/hand()
|
||||
hand_box.name = mymob.get_held_index_name(i)
|
||||
hand_box.icon = ui_style
|
||||
hand_box.icon_state = "hand_[mymob.held_index_to_dir(i)]"
|
||||
hand_box.screen_loc = ui_hand_position(i)
|
||||
hand_box.held_index = i
|
||||
hand_slots["[i]"] = hand_box
|
||||
hand_box.hud = src
|
||||
static_inventory += hand_box
|
||||
hand_box.update_icon()
|
||||
|
||||
var/i = 1
|
||||
for(var/obj/screen/swap_hand/SH in static_inventory)
|
||||
SH.screen_loc = ui_swaphand_position(mymob,!(i % 2) ? 2: 1)
|
||||
i++
|
||||
for(var/obj/screen/human/equip/E in static_inventory)
|
||||
E.screen_loc = ui_equip_position(mymob)
|
||||
if(mymob.hud_used)
|
||||
show_hud(HUD_STYLE_STANDARD,mymob)
|
||||
|
||||
/datum/hud/proc/update_locked_slots()
|
||||
return
|
||||
+426
-426
@@ -1,318 +1,318 @@
|
||||
/obj/screen/human
|
||||
icon = 'icons/mob/screen_midnight.dmi'
|
||||
|
||||
/obj/screen/human/toggle
|
||||
name = "toggle"
|
||||
icon_state = "toggle"
|
||||
|
||||
/obj/screen/human/toggle/Click()
|
||||
|
||||
var/mob/targetmob = usr
|
||||
|
||||
if(isobserver(usr))
|
||||
if(ishuman(usr.client.eye) && (usr.client.eye != usr))
|
||||
var/mob/M = usr.client.eye
|
||||
targetmob = M
|
||||
|
||||
if(usr.hud_used.inventory_shown && targetmob.hud_used)
|
||||
usr.hud_used.inventory_shown = 0
|
||||
usr.client.screen -= targetmob.hud_used.toggleable_inventory
|
||||
else
|
||||
usr.hud_used.inventory_shown = 1
|
||||
usr.client.screen += targetmob.hud_used.toggleable_inventory
|
||||
|
||||
targetmob.hud_used.hidden_inventory_update(usr)
|
||||
|
||||
/obj/screen/human/equip
|
||||
name = "equip"
|
||||
icon_state = "act_equip"
|
||||
|
||||
/obj/screen/human/equip/Click()
|
||||
if(istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
|
||||
return 1
|
||||
var/mob/living/carbon/human/H = usr
|
||||
H.quick_equip()
|
||||
|
||||
/obj/screen/devil
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/obj/screen/devil/soul_counter
|
||||
icon = 'icons/mob/screen_gen.dmi'
|
||||
name = "souls owned"
|
||||
icon_state = "Devil-6"
|
||||
screen_loc = ui_devilsouldisplay
|
||||
|
||||
/obj/screen/devil/soul_counter/proc/update_counter(souls = 0)
|
||||
invisibility = 0
|
||||
maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#FF0000'>[souls]</font></div>"
|
||||
switch(souls)
|
||||
if(0,null)
|
||||
icon_state = "Devil-1"
|
||||
if(1,2)
|
||||
icon_state = "Devil-2"
|
||||
if(3 to 5)
|
||||
icon_state = "Devil-3"
|
||||
if(6 to 8)
|
||||
icon_state = "Devil-4"
|
||||
if(9 to INFINITY)
|
||||
icon_state = "Devil-5"
|
||||
else
|
||||
icon_state = "Devil-6"
|
||||
|
||||
/obj/screen/devil/soul_counter/proc/clear()
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/obj/screen/ling
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/obj/screen/ling/sting
|
||||
name = "current sting"
|
||||
screen_loc = ui_lingstingdisplay
|
||||
|
||||
/obj/screen/ling/sting/Click()
|
||||
if(isobserver(usr))
|
||||
return
|
||||
var/mob/living/carbon/U = usr
|
||||
U.unset_sting()
|
||||
|
||||
/obj/screen/ling/chems
|
||||
name = "chemical storage"
|
||||
icon_state = "power_display"
|
||||
screen_loc = ui_lingchemdisplay
|
||||
|
||||
/mob/living/carbon/human/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
hud_used = new /datum/hud/human(src, ui_style2icon(client.prefs.UI_style))
|
||||
|
||||
|
||||
/datum/hud/human/New(mob/living/carbon/human/owner, ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
..()
|
||||
owner.overlay_fullscreen("see_through_darkness", /obj/screen/fullscreen/see_through_darkness)
|
||||
|
||||
var/obj/screen/using
|
||||
var/obj/screen/inventory/inv_box
|
||||
|
||||
using = new /obj/screen/craft
|
||||
using.icon = ui_style
|
||||
static_inventory += using
|
||||
|
||||
using = new/obj/screen/language_menu
|
||||
using.icon = ui_style
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/area_creator
|
||||
using.icon = ui_style
|
||||
static_inventory += using
|
||||
|
||||
action_intent = new /obj/screen/act_intent/segmented
|
||||
action_intent.icon_state = mymob.a_intent
|
||||
static_inventory += action_intent
|
||||
|
||||
using = new /obj/screen/mov_intent
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/drop()
|
||||
using.icon = ui_style
|
||||
using.screen_loc = ui_drop_throw
|
||||
static_inventory += using
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "i_clothing"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.slot_id = slot_w_uniform
|
||||
inv_box.icon_state = "uniform"
|
||||
inv_box.screen_loc = ui_iclothing
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "o_clothing"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.slot_id = slot_wear_suit
|
||||
inv_box.icon_state = "suit"
|
||||
inv_box.screen_loc = ui_oclothing
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
build_hand_slots(ui_style)
|
||||
|
||||
using = new /obj/screen/swap_hand()
|
||||
using.icon = ui_style
|
||||
using.icon_state = "swap_1"
|
||||
using.screen_loc = ui_swaphand_position(owner,1)
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/swap_hand()
|
||||
using.icon = ui_style
|
||||
using.icon_state = "swap_2"
|
||||
using.screen_loc = ui_swaphand_position(owner,2)
|
||||
static_inventory += using
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "id"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "id"
|
||||
inv_box.screen_loc = ui_id
|
||||
inv_box.slot_id = slot_wear_id
|
||||
static_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "mask"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "mask"
|
||||
inv_box.screen_loc = ui_mask
|
||||
inv_box.slot_id = slot_wear_mask
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "neck"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "neck"
|
||||
inv_box.screen_loc = ui_neck
|
||||
inv_box.slot_id = slot_neck
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "back"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "back"
|
||||
inv_box.screen_loc = ui_back
|
||||
inv_box.slot_id = slot_back
|
||||
static_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "storage1"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "pocket"
|
||||
inv_box.screen_loc = ui_storage1
|
||||
inv_box.slot_id = slot_l_store
|
||||
static_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "storage2"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "pocket"
|
||||
inv_box.screen_loc = ui_storage2
|
||||
inv_box.slot_id = slot_r_store
|
||||
static_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "suit storage"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "suit_storage"
|
||||
inv_box.screen_loc = ui_sstore1
|
||||
inv_box.slot_id = slot_s_store
|
||||
static_inventory += inv_box
|
||||
|
||||
using = new /obj/screen/resist()
|
||||
using.icon = ui_style
|
||||
using.screen_loc = ui_pull_resist
|
||||
hotkeybuttons += using
|
||||
|
||||
using = new /obj/screen/human/toggle()
|
||||
using.icon = ui_style
|
||||
using.screen_loc = ui_inventory
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/human/equip()
|
||||
using.icon = ui_style
|
||||
using.screen_loc = ui_equip_position(mymob)
|
||||
static_inventory += using
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "gloves"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "gloves"
|
||||
inv_box.screen_loc = ui_gloves
|
||||
inv_box.slot_id = slot_gloves
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "eyes"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "glasses"
|
||||
inv_box.screen_loc = ui_glasses
|
||||
inv_box.slot_id = slot_glasses
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "ears"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "ears"
|
||||
inv_box.screen_loc = ui_ears
|
||||
inv_box.slot_id = slot_ears
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "head"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "head"
|
||||
inv_box.screen_loc = ui_head
|
||||
inv_box.slot_id = slot_head
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "shoes"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "shoes"
|
||||
inv_box.screen_loc = ui_shoes
|
||||
inv_box.slot_id = slot_shoes
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "belt"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "belt"
|
||||
// inv_box.icon_full = "template_small"
|
||||
inv_box.screen_loc = ui_belt
|
||||
inv_box.slot_id = slot_belt
|
||||
static_inventory += inv_box
|
||||
|
||||
throw_icon = new /obj/screen/throw_catch()
|
||||
throw_icon.icon = ui_style
|
||||
throw_icon.screen_loc = ui_drop_throw
|
||||
hotkeybuttons += throw_icon
|
||||
|
||||
internals = new /obj/screen/internals()
|
||||
infodisplay += internals
|
||||
|
||||
healths = new /obj/screen/healths()
|
||||
infodisplay += healths
|
||||
|
||||
//citadel code
|
||||
arousal = new /obj/screen/arousal()
|
||||
infodisplay += arousal
|
||||
|
||||
healthdoll = new /obj/screen/healthdoll()
|
||||
infodisplay += healthdoll
|
||||
|
||||
pull_icon = new /obj/screen/pull()
|
||||
pull_icon.icon = ui_style
|
||||
pull_icon.update_icon(mymob)
|
||||
pull_icon.screen_loc = ui_pull_resist
|
||||
static_inventory += pull_icon
|
||||
|
||||
lingchemdisplay = new /obj/screen/ling/chems()
|
||||
infodisplay += lingchemdisplay
|
||||
|
||||
lingstingdisplay = new /obj/screen/ling/sting()
|
||||
infodisplay += lingstingdisplay
|
||||
|
||||
devilsouldisplay = new /obj/screen/devil/soul_counter
|
||||
infodisplay += devilsouldisplay
|
||||
|
||||
zone_select = new /obj/screen/zone_sel()
|
||||
zone_select.icon = ui_style
|
||||
zone_select.update_icon(mymob)
|
||||
static_inventory += zone_select
|
||||
|
||||
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
|
||||
if(inv.slot_id)
|
||||
inv.hud = src
|
||||
inv_slots[inv.slot_id] = inv
|
||||
inv.update_icon()
|
||||
|
||||
/obj/screen/human
|
||||
icon = 'icons/mob/screen_midnight.dmi'
|
||||
|
||||
/obj/screen/human/toggle
|
||||
name = "toggle"
|
||||
icon_state = "toggle"
|
||||
|
||||
/obj/screen/human/toggle/Click()
|
||||
|
||||
var/mob/targetmob = usr
|
||||
|
||||
if(isobserver(usr))
|
||||
if(ishuman(usr.client.eye) && (usr.client.eye != usr))
|
||||
var/mob/M = usr.client.eye
|
||||
targetmob = M
|
||||
|
||||
if(usr.hud_used.inventory_shown && targetmob.hud_used)
|
||||
usr.hud_used.inventory_shown = 0
|
||||
usr.client.screen -= targetmob.hud_used.toggleable_inventory
|
||||
else
|
||||
usr.hud_used.inventory_shown = 1
|
||||
usr.client.screen += targetmob.hud_used.toggleable_inventory
|
||||
|
||||
targetmob.hud_used.hidden_inventory_update(usr)
|
||||
|
||||
/obj/screen/human/equip
|
||||
name = "equip"
|
||||
icon_state = "act_equip"
|
||||
|
||||
/obj/screen/human/equip/Click()
|
||||
if(istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
|
||||
return 1
|
||||
var/mob/living/carbon/human/H = usr
|
||||
H.quick_equip()
|
||||
|
||||
/obj/screen/devil
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/obj/screen/devil/soul_counter
|
||||
icon = 'icons/mob/screen_gen.dmi'
|
||||
name = "souls owned"
|
||||
icon_state = "Devil-6"
|
||||
screen_loc = ui_devilsouldisplay
|
||||
|
||||
/obj/screen/devil/soul_counter/proc/update_counter(souls = 0)
|
||||
invisibility = 0
|
||||
maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font color='#FF0000'>[souls]</font></div>"
|
||||
switch(souls)
|
||||
if(0,null)
|
||||
icon_state = "Devil-1"
|
||||
if(1,2)
|
||||
icon_state = "Devil-2"
|
||||
if(3 to 5)
|
||||
icon_state = "Devil-3"
|
||||
if(6 to 8)
|
||||
icon_state = "Devil-4"
|
||||
if(9 to INFINITY)
|
||||
icon_state = "Devil-5"
|
||||
else
|
||||
icon_state = "Devil-6"
|
||||
|
||||
/obj/screen/devil/soul_counter/proc/clear()
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/obj/screen/ling
|
||||
invisibility = INVISIBILITY_ABSTRACT
|
||||
|
||||
/obj/screen/ling/sting
|
||||
name = "current sting"
|
||||
screen_loc = ui_lingstingdisplay
|
||||
|
||||
/obj/screen/ling/sting/Click()
|
||||
if(isobserver(usr))
|
||||
return
|
||||
var/mob/living/carbon/U = usr
|
||||
U.unset_sting()
|
||||
|
||||
/obj/screen/ling/chems
|
||||
name = "chemical storage"
|
||||
icon_state = "power_display"
|
||||
screen_loc = ui_lingchemdisplay
|
||||
|
||||
/mob/living/carbon/human/create_mob_hud()
|
||||
if(client && !hud_used)
|
||||
hud_used = new /datum/hud/human(src, ui_style2icon(client.prefs.UI_style))
|
||||
|
||||
|
||||
/datum/hud/human/New(mob/living/carbon/human/owner, ui_style = 'icons/mob/screen_midnight.dmi')
|
||||
..()
|
||||
owner.overlay_fullscreen("see_through_darkness", /obj/screen/fullscreen/see_through_darkness)
|
||||
|
||||
var/obj/screen/using
|
||||
var/obj/screen/inventory/inv_box
|
||||
|
||||
using = new /obj/screen/craft
|
||||
using.icon = ui_style
|
||||
static_inventory += using
|
||||
|
||||
using = new/obj/screen/language_menu
|
||||
using.icon = ui_style
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/area_creator
|
||||
using.icon = ui_style
|
||||
static_inventory += using
|
||||
|
||||
action_intent = new /obj/screen/act_intent/segmented
|
||||
action_intent.icon_state = mymob.a_intent
|
||||
static_inventory += action_intent
|
||||
|
||||
using = new /obj/screen/mov_intent
|
||||
using.icon = ui_style
|
||||
using.icon_state = (mymob.m_intent == MOVE_INTENT_RUN ? "running" : "walking")
|
||||
using.screen_loc = ui_movi
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/drop()
|
||||
using.icon = ui_style
|
||||
using.screen_loc = ui_drop_throw
|
||||
static_inventory += using
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "i_clothing"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.slot_id = slot_w_uniform
|
||||
inv_box.icon_state = "uniform"
|
||||
inv_box.screen_loc = ui_iclothing
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "o_clothing"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.slot_id = slot_wear_suit
|
||||
inv_box.icon_state = "suit"
|
||||
inv_box.screen_loc = ui_oclothing
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
build_hand_slots(ui_style)
|
||||
|
||||
using = new /obj/screen/swap_hand()
|
||||
using.icon = ui_style
|
||||
using.icon_state = "swap_1"
|
||||
using.screen_loc = ui_swaphand_position(owner,1)
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/swap_hand()
|
||||
using.icon = ui_style
|
||||
using.icon_state = "swap_2"
|
||||
using.screen_loc = ui_swaphand_position(owner,2)
|
||||
static_inventory += using
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "id"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "id"
|
||||
inv_box.screen_loc = ui_id
|
||||
inv_box.slot_id = slot_wear_id
|
||||
static_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "mask"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "mask"
|
||||
inv_box.screen_loc = ui_mask
|
||||
inv_box.slot_id = slot_wear_mask
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "neck"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "neck"
|
||||
inv_box.screen_loc = ui_neck
|
||||
inv_box.slot_id = slot_neck
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "back"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "back"
|
||||
inv_box.screen_loc = ui_back
|
||||
inv_box.slot_id = slot_back
|
||||
static_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "storage1"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "pocket"
|
||||
inv_box.screen_loc = ui_storage1
|
||||
inv_box.slot_id = slot_l_store
|
||||
static_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "storage2"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "pocket"
|
||||
inv_box.screen_loc = ui_storage2
|
||||
inv_box.slot_id = slot_r_store
|
||||
static_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "suit storage"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "suit_storage"
|
||||
inv_box.screen_loc = ui_sstore1
|
||||
inv_box.slot_id = slot_s_store
|
||||
static_inventory += inv_box
|
||||
|
||||
using = new /obj/screen/resist()
|
||||
using.icon = ui_style
|
||||
using.screen_loc = ui_pull_resist
|
||||
hotkeybuttons += using
|
||||
|
||||
using = new /obj/screen/human/toggle()
|
||||
using.icon = ui_style
|
||||
using.screen_loc = ui_inventory
|
||||
static_inventory += using
|
||||
|
||||
using = new /obj/screen/human/equip()
|
||||
using.icon = ui_style
|
||||
using.screen_loc = ui_equip_position(mymob)
|
||||
static_inventory += using
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "gloves"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "gloves"
|
||||
inv_box.screen_loc = ui_gloves
|
||||
inv_box.slot_id = slot_gloves
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "eyes"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "glasses"
|
||||
inv_box.screen_loc = ui_glasses
|
||||
inv_box.slot_id = slot_glasses
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "ears"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "ears"
|
||||
inv_box.screen_loc = ui_ears
|
||||
inv_box.slot_id = slot_ears
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "head"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "head"
|
||||
inv_box.screen_loc = ui_head
|
||||
inv_box.slot_id = slot_head
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "shoes"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "shoes"
|
||||
inv_box.screen_loc = ui_shoes
|
||||
inv_box.slot_id = slot_shoes
|
||||
toggleable_inventory += inv_box
|
||||
|
||||
inv_box = new /obj/screen/inventory()
|
||||
inv_box.name = "belt"
|
||||
inv_box.icon = ui_style
|
||||
inv_box.icon_state = "belt"
|
||||
// inv_box.icon_full = "template_small"
|
||||
inv_box.screen_loc = ui_belt
|
||||
inv_box.slot_id = slot_belt
|
||||
static_inventory += inv_box
|
||||
|
||||
throw_icon = new /obj/screen/throw_catch()
|
||||
throw_icon.icon = ui_style
|
||||
throw_icon.screen_loc = ui_drop_throw
|
||||
hotkeybuttons += throw_icon
|
||||
|
||||
internals = new /obj/screen/internals()
|
||||
infodisplay += internals
|
||||
|
||||
healths = new /obj/screen/healths()
|
||||
infodisplay += healths
|
||||
|
||||
//citadel code
|
||||
arousal = new /obj/screen/arousal()
|
||||
infodisplay += arousal
|
||||
|
||||
healthdoll = new /obj/screen/healthdoll()
|
||||
infodisplay += healthdoll
|
||||
|
||||
pull_icon = new /obj/screen/pull()
|
||||
pull_icon.icon = ui_style
|
||||
pull_icon.update_icon(mymob)
|
||||
pull_icon.screen_loc = ui_pull_resist
|
||||
static_inventory += pull_icon
|
||||
|
||||
lingchemdisplay = new /obj/screen/ling/chems()
|
||||
infodisplay += lingchemdisplay
|
||||
|
||||
lingstingdisplay = new /obj/screen/ling/sting()
|
||||
infodisplay += lingstingdisplay
|
||||
|
||||
devilsouldisplay = new /obj/screen/devil/soul_counter
|
||||
infodisplay += devilsouldisplay
|
||||
|
||||
zone_select = new /obj/screen/zone_sel()
|
||||
zone_select.icon = ui_style
|
||||
zone_select.update_icon(mymob)
|
||||
static_inventory += zone_select
|
||||
|
||||
for(var/obj/screen/inventory/inv in (static_inventory + toggleable_inventory))
|
||||
if(inv.slot_id)
|
||||
inv.hud = src
|
||||
inv_slots[inv.slot_id] = inv
|
||||
inv.update_icon()
|
||||
|
||||
/datum/hud/human/update_locked_slots()
|
||||
if(!mymob)
|
||||
return
|
||||
@@ -325,114 +325,114 @@
|
||||
else
|
||||
inv.alpha = initial(inv.alpha)
|
||||
|
||||
/datum/hud/human/hidden_inventory_update(mob/viewer)
|
||||
if(!mymob)
|
||||
return
|
||||
var/mob/living/carbon/human/H = mymob
|
||||
|
||||
var/mob/screenmob = viewer || H
|
||||
|
||||
if(screenmob.hud_used.inventory_shown && screenmob.hud_used.hud_shown)
|
||||
if(H.shoes)
|
||||
H.shoes.screen_loc = ui_shoes
|
||||
screenmob.client.screen += H.shoes
|
||||
if(H.gloves)
|
||||
H.gloves.screen_loc = ui_gloves
|
||||
screenmob.client.screen += H.gloves
|
||||
if(H.ears)
|
||||
H.ears.screen_loc = ui_ears
|
||||
screenmob.client.screen += H.ears
|
||||
if(H.glasses)
|
||||
H.glasses.screen_loc = ui_glasses
|
||||
screenmob.client.screen += H.glasses
|
||||
if(H.w_uniform)
|
||||
H.w_uniform.screen_loc = ui_iclothing
|
||||
screenmob.client.screen += H.w_uniform
|
||||
if(H.wear_suit)
|
||||
H.wear_suit.screen_loc = ui_oclothing
|
||||
screenmob.client.screen += H.wear_suit
|
||||
if(H.wear_mask)
|
||||
H.wear_mask.screen_loc = ui_mask
|
||||
screenmob.client.screen += H.wear_mask
|
||||
if(H.wear_neck)
|
||||
H.wear_neck.screen_loc = ui_neck
|
||||
screenmob.client.screen += H.wear_neck
|
||||
if(H.head)
|
||||
H.head.screen_loc = ui_head
|
||||
screenmob.client.screen += H.head
|
||||
else
|
||||
if(H.shoes) screenmob.client.screen -= H.shoes
|
||||
if(H.gloves) screenmob.client.screen -= H.gloves
|
||||
if(H.ears) screenmob.client.screen -= H.ears
|
||||
if(H.glasses) screenmob.client.screen -= H.glasses
|
||||
if(H.w_uniform) screenmob.client.screen -= H.w_uniform
|
||||
if(H.wear_suit) screenmob.client.screen -= H.wear_suit
|
||||
if(H.wear_mask) screenmob.client.screen -= H.wear_mask
|
||||
if(H.wear_neck) screenmob.client.screen -= H.wear_neck
|
||||
if(H.head) screenmob.client.screen -= H.head
|
||||
|
||||
|
||||
|
||||
/datum/hud/human/persistent_inventory_update(mob/viewer)
|
||||
if(!mymob)
|
||||
return
|
||||
..()
|
||||
var/mob/living/carbon/human/H = mymob
|
||||
|
||||
var/mob/screenmob = viewer || H
|
||||
|
||||
if(screenmob.hud_used)
|
||||
if(screenmob.hud_used.hud_shown)
|
||||
if(H.s_store)
|
||||
H.s_store.screen_loc = ui_sstore1
|
||||
screenmob.client.screen += H.s_store
|
||||
if(H.wear_id)
|
||||
H.wear_id.screen_loc = ui_id
|
||||
screenmob.client.screen += H.wear_id
|
||||
if(H.belt)
|
||||
H.belt.screen_loc = ui_belt
|
||||
screenmob.client.screen += H.belt
|
||||
if(H.back)
|
||||
H.back.screen_loc = ui_back
|
||||
screenmob.client.screen += H.back
|
||||
if(H.l_store)
|
||||
H.l_store.screen_loc = ui_storage1
|
||||
screenmob.client.screen += H.l_store
|
||||
if(H.r_store)
|
||||
H.r_store.screen_loc = ui_storage2
|
||||
screenmob.client.screen += H.r_store
|
||||
else
|
||||
if(H.s_store)
|
||||
screenmob.client.screen -= H.s_store
|
||||
if(H.wear_id)
|
||||
screenmob.client.screen -= H.wear_id
|
||||
if(H.belt)
|
||||
screenmob.client.screen -= H.belt
|
||||
if(H.back)
|
||||
screenmob.client.screen -= H.back
|
||||
if(H.l_store)
|
||||
screenmob.client.screen -= H.l_store
|
||||
if(H.r_store)
|
||||
screenmob.client.screen -= H.r_store
|
||||
|
||||
if(hud_version != HUD_STYLE_NOHUD)
|
||||
for(var/obj/item/I in H.held_items)
|
||||
I.screen_loc = ui_hand_position(H.get_held_index_of_item(I))
|
||||
screenmob.client.screen += I
|
||||
else
|
||||
for(var/obj/item/I in H.held_items)
|
||||
I.screen_loc = null
|
||||
screenmob.client.screen -= I
|
||||
|
||||
|
||||
/mob/living/carbon/human/verb/toggle_hotkey_verbs()
|
||||
set category = "OOC"
|
||||
set name = "Toggle hotkey buttons"
|
||||
set desc = "This disables or enables the user interface buttons which can be used with hotkeys."
|
||||
|
||||
if(hud_used.hotkey_ui_hidden)
|
||||
client.screen += hud_used.hotkeybuttons
|
||||
hud_used.hotkey_ui_hidden = 0
|
||||
else
|
||||
client.screen -= hud_used.hotkeybuttons
|
||||
hud_used.hotkey_ui_hidden = 1
|
||||
/datum/hud/human/hidden_inventory_update(mob/viewer)
|
||||
if(!mymob)
|
||||
return
|
||||
var/mob/living/carbon/human/H = mymob
|
||||
|
||||
var/mob/screenmob = viewer || H
|
||||
|
||||
if(screenmob.hud_used.inventory_shown && screenmob.hud_used.hud_shown)
|
||||
if(H.shoes)
|
||||
H.shoes.screen_loc = ui_shoes
|
||||
screenmob.client.screen += H.shoes
|
||||
if(H.gloves)
|
||||
H.gloves.screen_loc = ui_gloves
|
||||
screenmob.client.screen += H.gloves
|
||||
if(H.ears)
|
||||
H.ears.screen_loc = ui_ears
|
||||
screenmob.client.screen += H.ears
|
||||
if(H.glasses)
|
||||
H.glasses.screen_loc = ui_glasses
|
||||
screenmob.client.screen += H.glasses
|
||||
if(H.w_uniform)
|
||||
H.w_uniform.screen_loc = ui_iclothing
|
||||
screenmob.client.screen += H.w_uniform
|
||||
if(H.wear_suit)
|
||||
H.wear_suit.screen_loc = ui_oclothing
|
||||
screenmob.client.screen += H.wear_suit
|
||||
if(H.wear_mask)
|
||||
H.wear_mask.screen_loc = ui_mask
|
||||
screenmob.client.screen += H.wear_mask
|
||||
if(H.wear_neck)
|
||||
H.wear_neck.screen_loc = ui_neck
|
||||
screenmob.client.screen += H.wear_neck
|
||||
if(H.head)
|
||||
H.head.screen_loc = ui_head
|
||||
screenmob.client.screen += H.head
|
||||
else
|
||||
if(H.shoes) screenmob.client.screen -= H.shoes
|
||||
if(H.gloves) screenmob.client.screen -= H.gloves
|
||||
if(H.ears) screenmob.client.screen -= H.ears
|
||||
if(H.glasses) screenmob.client.screen -= H.glasses
|
||||
if(H.w_uniform) screenmob.client.screen -= H.w_uniform
|
||||
if(H.wear_suit) screenmob.client.screen -= H.wear_suit
|
||||
if(H.wear_mask) screenmob.client.screen -= H.wear_mask
|
||||
if(H.wear_neck) screenmob.client.screen -= H.wear_neck
|
||||
if(H.head) screenmob.client.screen -= H.head
|
||||
|
||||
|
||||
|
||||
/datum/hud/human/persistent_inventory_update(mob/viewer)
|
||||
if(!mymob)
|
||||
return
|
||||
..()
|
||||
var/mob/living/carbon/human/H = mymob
|
||||
|
||||
var/mob/screenmob = viewer || H
|
||||
|
||||
if(screenmob.hud_used)
|
||||
if(screenmob.hud_used.hud_shown)
|
||||
if(H.s_store)
|
||||
H.s_store.screen_loc = ui_sstore1
|
||||
screenmob.client.screen += H.s_store
|
||||
if(H.wear_id)
|
||||
H.wear_id.screen_loc = ui_id
|
||||
screenmob.client.screen += H.wear_id
|
||||
if(H.belt)
|
||||
H.belt.screen_loc = ui_belt
|
||||
screenmob.client.screen += H.belt
|
||||
if(H.back)
|
||||
H.back.screen_loc = ui_back
|
||||
screenmob.client.screen += H.back
|
||||
if(H.l_store)
|
||||
H.l_store.screen_loc = ui_storage1
|
||||
screenmob.client.screen += H.l_store
|
||||
if(H.r_store)
|
||||
H.r_store.screen_loc = ui_storage2
|
||||
screenmob.client.screen += H.r_store
|
||||
else
|
||||
if(H.s_store)
|
||||
screenmob.client.screen -= H.s_store
|
||||
if(H.wear_id)
|
||||
screenmob.client.screen -= H.wear_id
|
||||
if(H.belt)
|
||||
screenmob.client.screen -= H.belt
|
||||
if(H.back)
|
||||
screenmob.client.screen -= H.back
|
||||
if(H.l_store)
|
||||
screenmob.client.screen -= H.l_store
|
||||
if(H.r_store)
|
||||
screenmob.client.screen -= H.r_store
|
||||
|
||||
if(hud_version != HUD_STYLE_NOHUD)
|
||||
for(var/obj/item/I in H.held_items)
|
||||
I.screen_loc = ui_hand_position(H.get_held_index_of_item(I))
|
||||
screenmob.client.screen += I
|
||||
else
|
||||
for(var/obj/item/I in H.held_items)
|
||||
I.screen_loc = null
|
||||
screenmob.client.screen -= I
|
||||
|
||||
|
||||
/mob/living/carbon/human/verb/toggle_hotkey_verbs()
|
||||
set category = "OOC"
|
||||
set name = "Toggle hotkey buttons"
|
||||
set desc = "This disables or enables the user interface buttons which can be used with hotkeys."
|
||||
|
||||
if(hud_used.hotkey_ui_hidden)
|
||||
client.screen += hud_used.hotkeybuttons
|
||||
hud_used.hotkey_ui_hidden = 0
|
||||
else
|
||||
client.screen -= hud_used.hotkeybuttons
|
||||
hud_used.hotkey_ui_hidden = 1
|
||||
|
||||
@@ -91,10 +91,9 @@
|
||||
screen_loc = ui_language_menu
|
||||
|
||||
/obj/screen/language_menu/Click()
|
||||
var/mob/living/L = usr
|
||||
if(!istype(L))
|
||||
return
|
||||
L.open_language_menu(usr)
|
||||
var/mob/M = usr
|
||||
var/datum/language_holder/H = M.get_language_holder()
|
||||
H.open_language_menu(usr)
|
||||
|
||||
/obj/screen/inventory
|
||||
var/slot_id // The indentifier for the slot. It has nothing to do with ID cards.
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
if(sharpness)
|
||||
to_chat(user, "<span class='notice'>You begin to butcher [src]...</span>")
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
|
||||
if(do_mob(user, src, 80/sharpness))
|
||||
if(do_mob(user, src, 80/sharpness) && Adjacent(I))
|
||||
harvest(user)
|
||||
return 1
|
||||
return I.attack(src, user)
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
var/arousal_gain_rate = 1 //Rate at which this species becomes aroused
|
||||
var/arousal_lose_rate = 1 //Multiplier for how easily arousal can be relieved
|
||||
var/list/cum_fluids = list("semen")
|
||||
var/list/milk_fludis = list("milk")
|
||||
var/list/milk_fluids = list("milk")
|
||||
var/list/femcum_fluids = list("femcum")
|
||||
|
||||
//Mob procs
|
||||
@@ -285,4 +285,4 @@
|
||||
/mob/living/carbon/proc/force_orgasm(intensity)
|
||||
if(canbearoused && has_dna() && (has_penis() || has_vagina()))
|
||||
return 1
|
||||
return 0
|
||||
return 0
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
INITIALIZE_IMMEDIATE(/obj/effect/statclick)
|
||||
|
||||
/obj/effect/statclick/Initialize(mapload, text, target) //Don't port this to Initialize it's too critical
|
||||
..()
|
||||
. = ..()
|
||||
name = text
|
||||
src.target = target
|
||||
|
||||
|
||||
@@ -162,8 +162,8 @@
|
||||
var/alert_desc_red_downto = "The station's destruction has been averted. There is still however an immediate serious threat to the station. Security may have weapons unholstered at all times, random searches are allowed and advised."
|
||||
var/alert_desc_delta = "Destruction of the station is imminent. All crew are instructed to obey all instructions given by heads of staff. Any violations of these orders can be punished by death. This is not a drill."
|
||||
|
||||
var/revival_pod_plants = 1
|
||||
var/revival_cloning = 1
|
||||
var/revival_pod_plants = FALSE
|
||||
var/revival_cloning = FALSE
|
||||
var/revival_brain_life = -1
|
||||
|
||||
var/rename_cyborg = 0
|
||||
@@ -259,6 +259,8 @@
|
||||
var/arrivals_shuttle_dock_window = 55 //Time from when a player late joins on the arrivals shuttle to when the shuttle docks on the station
|
||||
var/arrivals_shuttle_require_safe_latejoin = FALSE //Require the arrivals shuttle to be operational in order for latejoiners to join
|
||||
|
||||
var/mice_roundstart = 10 // how many wire chewing rodents spawn at roundstart.
|
||||
|
||||
/datum/configuration/New()
|
||||
gamemode_cache = typecacheof(/datum/game_mode,TRUE)
|
||||
for(var/T in gamemode_cache)
|
||||
@@ -278,7 +280,6 @@
|
||||
votable_modes += "secret"
|
||||
|
||||
Reload()
|
||||
reload_custom_roundstart_items_list()
|
||||
|
||||
/datum/configuration/proc/Reload()
|
||||
load("config/config.txt")
|
||||
@@ -543,9 +544,9 @@
|
||||
if("damage_multiplier")
|
||||
damage_multiplier = text2num(value)
|
||||
if("revival_pod_plants")
|
||||
revival_pod_plants = text2num(value)
|
||||
revival_pod_plants = TRUE
|
||||
if("revival_cloning")
|
||||
revival_cloning = text2num(value)
|
||||
revival_cloning = TRUE
|
||||
if("revival_brain_life")
|
||||
revival_brain_life = text2num(value)
|
||||
if("rename_cyborg")
|
||||
@@ -765,13 +766,15 @@
|
||||
if("arrivals_shuttle_dock_window")
|
||||
arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value))
|
||||
if("arrivals_shuttle_require_safe_latejoin")
|
||||
arrivals_shuttle_require_safe_latejoin = text2num(value)
|
||||
arrivals_shuttle_require_safe_latejoin = TRUE
|
||||
if("mice_roundstart")
|
||||
mice_roundstart = text2num(value)
|
||||
if ("mentor_mobname_only")
|
||||
mentors_mobname_only = 1
|
||||
if ("mentor_legacy_system")
|
||||
mentor_legacy_system = 1
|
||||
// else
|
||||
// GLOB.config_error_log << "Adding game mode [M.name] ([M.config_tag]) to configuration."
|
||||
else
|
||||
GLOB.config_error_log << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
fps = round(fps)
|
||||
if(fps <= 0)
|
||||
|
||||
+54
-41
@@ -47,8 +47,6 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
var/make_runtime = 0
|
||||
|
||||
var/initializations_finished_with_no_players_logged_in //I wonder what this could be?
|
||||
// Has round started? (So we know what subsystems to run)
|
||||
var/local_round_started = FALSE //Don't read this var, use SSticker.HasRoundStarted() instead
|
||||
|
||||
// The type of the last subsystem to be process()'d.
|
||||
var/last_type_processed
|
||||
@@ -59,6 +57,8 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
var/queue_priority_count_bg = 0 //Same, but for background subsystems
|
||||
var/map_loading = FALSE //Are we loading in a new map?
|
||||
|
||||
var/current_runlevel //for scheduling different subsystems for different stages of the round
|
||||
|
||||
/datum/controller/master/New()
|
||||
// Highlander-style: there can only be one! Kill off the old and replace it with the new.
|
||||
subsystems = list()
|
||||
@@ -132,7 +132,7 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
msg = "The [BadBoy.name] subsystem seems to be destabilizing the MC and will be offlined."
|
||||
BadBoy.flags |= SS_NO_FIRE
|
||||
if(msg)
|
||||
to_chat(GLOB.admins, "<span class='boldannounce'>[msg]</span>")
|
||||
to_chat(GLOB.admins, "<span class='boldannounce'>[msg]</span>")
|
||||
log_world(msg)
|
||||
|
||||
if (istype(Master.subsystems))
|
||||
@@ -176,6 +176,8 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
to_chat(world, "<span class='boldannounce'>[msg]</span>")
|
||||
log_world(msg)
|
||||
|
||||
SetRunLevel(1)
|
||||
|
||||
// Sort subsystems by display setting for easy access.
|
||||
sortTim(subsystems, /proc/cmp_subsystem_display)
|
||||
// Set world options.
|
||||
@@ -187,16 +189,15 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
// Loop.
|
||||
Master.StartProcessing(0)
|
||||
|
||||
// Notify the MC that the round has started.
|
||||
/datum/controller/master/proc/RoundStart()
|
||||
local_round_started = TRUE
|
||||
var/timer = world.time
|
||||
for (var/datum/controller/subsystem/SS in subsystems)
|
||||
if (SS.flags & SS_FIRE_IN_LOBBY || SS.flags & SS_TICKER)
|
||||
continue //already firing
|
||||
// Stagger subsystems.
|
||||
timer += world.tick_lag * rand(1, 5)
|
||||
SS.next_fire = timer
|
||||
/datum/controller/master/proc/SetRunLevel(new_runlevel)
|
||||
var/old_runlevel = current_runlevel
|
||||
if(isnull(old_runlevel))
|
||||
old_runlevel = "NULL"
|
||||
|
||||
testing("MC: Runlevel changed from [old_runlevel] to [new_runlevel]")
|
||||
current_runlevel = log(2, new_runlevel) + 1
|
||||
if(current_runlevel < 1)
|
||||
CRASH("Attempted to set invalid runlevel: [new_runlevel]")
|
||||
|
||||
// Starts the mc, and sticks around to restart it if the loop ever ends.
|
||||
/datum/controller/master/proc/StartProcessing(delay)
|
||||
@@ -221,12 +222,9 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
//Prep the loop (most of this is because we want MC restarts to reset as much state as we can, and because
|
||||
// local vars rock
|
||||
|
||||
// Schedule the first run of the Subsystems.
|
||||
local_round_started = world.has_round_started()
|
||||
//all this shit is here so that flag edits can be refreshed by restarting the MC. (and for speed)
|
||||
var/list/tickersubsystems = list()
|
||||
var/list/normalsubsystems = list()
|
||||
var/list/lobbysubsystems = list()
|
||||
var/list/runlevel_sorted_subsystems = list(list()) //ensure we always have at least one runlevel
|
||||
var/timer = world.time
|
||||
for (var/thing in subsystems)
|
||||
var/datum/controller/subsystem/SS = thing
|
||||
@@ -241,25 +239,29 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
timer += world.tick_lag * rand(1, 5)
|
||||
SS.next_fire = timer
|
||||
continue
|
||||
if (SS.flags & SS_FIRE_IN_LOBBY)
|
||||
lobbysubsystems += SS
|
||||
timer += world.tick_lag * rand(1, 5)
|
||||
SS.next_fire = timer
|
||||
else if (local_round_started)
|
||||
timer += world.tick_lag * rand(1, 5)
|
||||
SS.next_fire = timer
|
||||
normalsubsystems += SS
|
||||
|
||||
var/ss_runlevels = SS.runlevels
|
||||
var/added_to_any = FALSE
|
||||
for(var/I in 1 to GLOB.bitflags.len)
|
||||
if(ss_runlevels & GLOB.bitflags[I])
|
||||
while(runlevel_sorted_subsystems.len < I)
|
||||
runlevel_sorted_subsystems += list(list())
|
||||
runlevel_sorted_subsystems[I] += SS
|
||||
added_to_any = TRUE
|
||||
if(!added_to_any)
|
||||
WARNING("[SS.name] subsystem is not SS_NO_FIRE but also does not have any runlevels set!")
|
||||
|
||||
queue_head = null
|
||||
queue_tail = null
|
||||
//these sort by lower priorities first to reduce the number of loops needed to add subsequent SS's to the queue
|
||||
//(higher subsystems will be sooner in the queue, adding them later in the loop means we don't have to loop thru them next queue add)
|
||||
sortTim(tickersubsystems, /proc/cmp_subsystem_priority)
|
||||
sortTim(normalsubsystems, /proc/cmp_subsystem_priority)
|
||||
sortTim(lobbysubsystems, /proc/cmp_subsystem_priority)
|
||||
for(var/I in runlevel_sorted_subsystems)
|
||||
sortTim(runlevel_sorted_subsystems, /proc/cmp_subsystem_priority)
|
||||
I += tickersubsystems
|
||||
|
||||
normalsubsystems += tickersubsystems
|
||||
lobbysubsystems += tickersubsystems
|
||||
var/cached_runlevel = current_runlevel
|
||||
var/list/current_runlevel_subsystems = runlevel_sorted_subsystems[cached_runlevel]
|
||||
|
||||
init_timeofday = REALTIMEOFDAY
|
||||
init_time = world.time
|
||||
@@ -296,14 +298,23 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
if (!Failsafe || (Failsafe.processing_interval > 0 && (Failsafe.lasttick+(Failsafe.processing_interval*5)) < world.time))
|
||||
new/datum/controller/failsafe() // (re)Start the failsafe.
|
||||
if (!queue_head || !(iteration % 3))
|
||||
if (local_round_started)
|
||||
subsystems_to_check = normalsubsystems
|
||||
else
|
||||
subsystems_to_check = lobbysubsystems
|
||||
var/checking_runlevel = current_runlevel
|
||||
if(cached_runlevel != checking_runlevel)
|
||||
//resechedule subsystems
|
||||
cached_runlevel = checking_runlevel
|
||||
current_runlevel_subsystems = runlevel_sorted_subsystems[cached_runlevel]
|
||||
var/stagger = world.time
|
||||
for(var/I in current_runlevel_subsystems)
|
||||
var/datum/controller/subsystem/SS = I
|
||||
if(SS.next_fire <= world.time)
|
||||
stagger += world.tick_lag * rand(1, 5)
|
||||
SS.next_fire = stagger
|
||||
|
||||
subsystems_to_check = current_runlevel_subsystems
|
||||
else
|
||||
subsystems_to_check = tickersubsystems
|
||||
if (CheckQueue(subsystems_to_check) <= 0)
|
||||
if (!SoftReset(tickersubsystems, normalsubsystems, lobbysubsystems))
|
||||
if (!SoftReset(tickersubsystems, runlevel_sorted_subsystems))
|
||||
log_world("MC: SoftReset() failed, crashing")
|
||||
return
|
||||
if (!error_level)
|
||||
@@ -315,7 +326,7 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
|
||||
if (queue_head)
|
||||
if (RunQueue() <= 0)
|
||||
if (!SoftReset(tickersubsystems, normalsubsystems, lobbysubsystems))
|
||||
if (!SoftReset(tickersubsystems, runlevel_sorted_subsystems))
|
||||
log_world("MC: SoftReset() failed, crashing")
|
||||
return
|
||||
if (!error_level)
|
||||
@@ -491,13 +502,15 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
|
||||
//resets the queue, and all subsystems, while filtering out the subsystem lists
|
||||
// called if any mc's queue procs runtime or exit improperly.
|
||||
/datum/controller/master/proc/SoftReset(list/ticker_SS, list/normal_SS, list/lobby_SS)
|
||||
/datum/controller/master/proc/SoftReset(list/ticker_SS, list/runlevel_SS)
|
||||
. = 0
|
||||
log_world("MC: SoftReset called, resetting MC queue state.")
|
||||
if (!istype(subsystems) || !istype(ticker_SS) || !istype(normal_SS) || !istype(lobby_SS))
|
||||
log_world("MC: SoftReset: Bad list contents: '[subsystems]' '[ticker_SS]' '[normal_SS]' '[lobby_SS]' Crashing!")
|
||||
if (!istype(subsystems) || !istype(ticker_SS) || !istype(runlevel_SS))
|
||||
log_world("MC: SoftReset: Bad list contents: '[subsystems]' '[ticker_SS]' '[runlevel_SS]'")
|
||||
return
|
||||
var/subsystemstocheck = subsystems + ticker_SS + normal_SS + lobby_SS
|
||||
var/subsystemstocheck = subsystems + ticker_SS
|
||||
for(var/I in runlevel_SS)
|
||||
subsystemstocheck |= I
|
||||
|
||||
for (var/thing in subsystemstocheck)
|
||||
var/datum/controller/subsystem/SS = thing
|
||||
@@ -505,8 +518,8 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
//list(SS) is so if a list makes it in the subsystem list, we remove the list, not the contents
|
||||
subsystems -= list(SS)
|
||||
ticker_SS -= list(SS)
|
||||
normal_SS -= list(SS)
|
||||
lobby_SS -= list(SS)
|
||||
for(var/I in runlevel_SS)
|
||||
I -= list(SS)
|
||||
log_world("MC: SoftReset: Found bad entry in subsystem list, '[SS]'")
|
||||
continue
|
||||
if (SS.queue_next && !istype(SS.queue_next))
|
||||
|
||||
@@ -29,6 +29,8 @@
|
||||
var/datum/controller/subsystem/queue_next
|
||||
var/datum/controller/subsystem/queue_prev
|
||||
|
||||
var/runlevels = RUNLEVELS_DEFAULT //points of the game at which the SS can fire
|
||||
|
||||
var/static/failure_strikes = 0 //How many times we suspect this subsystem has crashed the MC, 3 strikes and you're out!
|
||||
|
||||
//Do not override
|
||||
|
||||
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(acid)
|
||||
name = "Acid"
|
||||
priority = 40
|
||||
flags = SS_NO_INIT|SS_BACKGROUND
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
@@ -12,6 +12,7 @@ SUBSYSTEM_DEF(air)
|
||||
priority = 20
|
||||
wait = 5
|
||||
flags = SS_BACKGROUND
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/cost_turfs = 0
|
||||
var/cost_groups = 0
|
||||
@@ -299,7 +300,7 @@ SUBSYSTEM_DEF(air)
|
||||
var/timer = world.timeofday
|
||||
warning("There are [starting_ats] active turfs at roundstart, this is a mapping error caused by a difference of the air between the adjacent turfs. You can see its coordinates using \"Mapping -> Show roundstart AT list\" verb (debug verbs required)")
|
||||
for(var/turf/T in active_turfs)
|
||||
GLOB.active_turfs_startlist += text("[T.x], [T.y], [T.z]\n")
|
||||
GLOB.active_turfs_startlist += T
|
||||
|
||||
//now lets clear out these active turfs
|
||||
var/list/turfs_to_check = active_turfs.Copy()
|
||||
|
||||
@@ -150,7 +150,7 @@ SUBSYSTEM_DEF(atoms)
|
||||
/datum/controller/subsystem/atoms/Shutdown()
|
||||
var/initlog = InitLog()
|
||||
if(initlog)
|
||||
log_world(initlog)
|
||||
text2file("[GLOB.log_directory]/initialize.log", initlog)
|
||||
|
||||
#undef BAD_INIT_QDEL_BEFORE
|
||||
#undef BAD_INIT_DIDNT_INIT
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
SUBSYSTEM_DEF(augury)
|
||||
name = "Augury"
|
||||
flags = SS_NO_INIT
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/watchers = list()
|
||||
var/list/doombringers = list()
|
||||
|
||||
@@ -2,7 +2,7 @@ SUBSYSTEM_DEF(blackbox)
|
||||
name = "Blackbox"
|
||||
wait = 6000
|
||||
flags = SS_NO_TICK_CHECK
|
||||
|
||||
|
||||
var/list/msg_common = list()
|
||||
var/list/msg_science = list()
|
||||
var/list/msg_command = list()
|
||||
@@ -91,7 +91,7 @@ SUBSYSTEM_DEF(blackbox)
|
||||
if (sqlrowlist != "")
|
||||
sqlrowlist += ", " //a comma (,) at the start of the first row to insert will trigger a SQL error
|
||||
|
||||
sqlrowlist += "(null, Now(), [GLOB.round_id], \"[sanitizeSQL(FV.get_variable())]\", [FV.get_value()], \"[sanitizeSQL(FV.get_details())]\")"
|
||||
sqlrowlist += list(list("time" = "Now()", "round_id" = GLOB.round_id, "var_name" = "'[sanitizeSQL(FV.get_variable())]'", "var_value" = FV.get_value(), "details" = "'[sanitizeSQL(FV.get_details())]'"))
|
||||
|
||||
if (sqlrowlist == "")
|
||||
return
|
||||
@@ -243,4 +243,4 @@ SUBSYSTEM_DEF(blackbox)
|
||||
return details
|
||||
|
||||
/datum/feedback_variable/proc/get_parsed()
|
||||
return list(variable,value,details)
|
||||
return list(variable,value,details)
|
||||
@@ -77,15 +77,87 @@ SUBSYSTEM_DEF(dbcore)
|
||||
return FALSE
|
||||
return _dm_db_is_connected(_db_con)
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/Quote(str)
|
||||
/datum/controller/subsystem/dbcore/proc/Quote(str)
|
||||
return _dm_db_quote(_db_con, str)
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/ErrorMsg()
|
||||
/datum/controller/subsystem/dbcore/proc/ErrorMsg()
|
||||
if(!config.sql_enabled)
|
||||
return "Database disabled by configuration"
|
||||
return _dm_db_error_msg(_db_con)
|
||||
|
||||
/datum/controller/subsystem/dbcore/proc/NewQuery(sql_query, cursor_handler = Default_Cursor)
|
||||
if(IsAdminAdvancedProcCall())
|
||||
log_admin_private("ERROR: Advanced admin proc call led to sql query: [sql_query]. Query has been blocked")
|
||||
message_admins("ERROR: Advanced admin proc call led to sql query. Query has been blocked")
|
||||
return FALSE
|
||||
return new /datum/DBQuery(sql_query, src, cursor_handler)
|
||||
|
||||
/*
|
||||
Takes a list of rows (each row being an associated list of column => value) and inserts them via a single mass query.
|
||||
Rows missing columns present in other rows will resolve to SQL NULL
|
||||
You are expected to do your own escaping of the data, and expected to provide your own quotes for strings.
|
||||
The duplicate_key arg can be true to automatically generate this part of the query
|
||||
or set to a string that is appended to the end of the query
|
||||
Ignore_errors instructes mysql to continue inserting rows if some of them have errors.
|
||||
the erroneous row(s) aren't inserted and there isn't really any way to know why or why errored
|
||||
Delayed insert mode was removed in mysql 7 and only works with MyISAM type tables,
|
||||
It was included because it is still supported in mariadb.
|
||||
It does not work with duplicate_key and the mysql server ignores it in those cases
|
||||
*/
|
||||
/datum/controller/subsystem/dbcore/proc/MassInsert(table, list/rows, duplicate_key = FALSE, ignore_errors = FALSE, delayed = FALSE, warn = FALSE)
|
||||
if (!table || !rows || !istype(rows))
|
||||
return
|
||||
var/list/columns = list()
|
||||
var/list/sorted_rows = list()
|
||||
|
||||
for (var/list/row in rows)
|
||||
var/list/sorted_row = list()
|
||||
sorted_row.len = columns.len
|
||||
for (var/column in row)
|
||||
var/idx = columns[column]
|
||||
if (!idx)
|
||||
idx = columns.len + 1
|
||||
columns[column] = idx
|
||||
sorted_row.len = columns.len
|
||||
|
||||
sorted_row[idx] = row[column]
|
||||
sorted_rows[++sorted_rows.len] = sorted_row
|
||||
|
||||
if (duplicate_key == TRUE)
|
||||
var/list/column_list = list()
|
||||
for (var/column in columns)
|
||||
column_list += "[column] = VALUES([column])"
|
||||
duplicate_key = "ON DUPLICATE KEY UPDATE [column_list.Join(", ")]\n"
|
||||
else if (duplicate_key == FALSE)
|
||||
duplicate_key = null
|
||||
|
||||
if (ignore_errors)
|
||||
ignore_errors = " IGNORE"
|
||||
else
|
||||
ignore_errors = null
|
||||
|
||||
if (delayed)
|
||||
delayed = " DELAYED"
|
||||
else
|
||||
delayed = null
|
||||
|
||||
var/list/sqlrowlist = list()
|
||||
var/len = columns.len
|
||||
for (var/list/row in sorted_rows)
|
||||
if (length(row) != len)
|
||||
row.len = len
|
||||
for (var/value in row)
|
||||
if (value == null)
|
||||
value = "NULL"
|
||||
sqlrowlist += "([row.Join(", ")])"
|
||||
|
||||
sqlrowlist = " [sqlrowlist.Join(",\n ")]"
|
||||
var/datum/DBQuery/Query = NewQuery("INSERT[delayed][ignore_errors] INTO [table]\n([columns.Join(", ")])\nVALUES\n[sqlrowlist]\n[duplicate_key]")
|
||||
if (warn)
|
||||
return Query.warn_execute()
|
||||
else
|
||||
return Query.Execute()
|
||||
|
||||
|
||||
/datum/DBQuery
|
||||
var/sql // The sql query being executed.
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
SUBSYSTEM_DEF(disease)
|
||||
name = "Disease"
|
||||
flags = SS_KEEP_TIMING|SS_NO_INIT
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
SUBSYSTEM_DEF(events)
|
||||
name = "Events"
|
||||
init_order = INIT_ORDER_EVENTS
|
||||
runlevels = RUNLEVEL_GAME
|
||||
|
||||
var/list/control = list() //list of all datum/round_event_control. Used for selecting events based on weight and occurrences.
|
||||
var/list/running = list() //list of all existing /datum/round_event
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
|
||||
SUBSYSTEM_DEF(fields)
|
||||
name = "Fields"
|
||||
wait = 2
|
||||
priority = 40
|
||||
flags = SS_KEEP_TIMING
|
||||
var/list/datum/proximity_monitor/advanced/running = list()
|
||||
var/list/datum/proximity_monitor/advanced/currentrun = list()
|
||||
|
||||
/datum/controller/subsystem/fields/fire(resumed = 0)
|
||||
if(!resumed)
|
||||
src.currentrun = running.Copy()
|
||||
var/list/currentrun = src.currentrun
|
||||
while(currentrun.len)
|
||||
var/datum/proximity_monitor/advanced/F = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if(!F.requires_processing)
|
||||
continue
|
||||
F.process()
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/fields/proc/register_new_field(datum/proximity_monitor/advanced/F)
|
||||
running += F
|
||||
|
||||
/datum/controller/subsystem/fields/proc/unregister_field(datum/proximity_monitor/advanced/F)
|
||||
running -= F
|
||||
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(fire_burning)
|
||||
name = "Fire Burning"
|
||||
priority = 40
|
||||
flags = SS_NO_INIT|SS_BACKGROUND
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
@@ -2,7 +2,8 @@ SUBSYSTEM_DEF(garbage)
|
||||
name = "Garbage"
|
||||
priority = 15
|
||||
wait = 5
|
||||
flags = SS_FIRE_IN_LOBBY|SS_POST_FIRE_TIMING|SS_BACKGROUND|SS_NO_INIT
|
||||
flags = SS_POST_FIRE_TIMING|SS_BACKGROUND|SS_NO_INIT
|
||||
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
|
||||
|
||||
var/collection_timeout = 3000// deciseconds to wait to let running procs finish before we just say fuck it and force del() the object
|
||||
var/delslasttick = 0 // number of del()'s we've done this tick
|
||||
@@ -60,7 +61,7 @@ SUBSYSTEM_DEF(garbage)
|
||||
for(var/path in sleptDestroy)
|
||||
dellog += "Path : [path] \n"
|
||||
dellog += "Sleeps : [sleptDestroy[path]] \n"
|
||||
log_world(dellog.Join())
|
||||
text2file("[GLOB.log_directory]/qdel.log", dellog.Join())
|
||||
|
||||
/datum/controller/subsystem/garbage/fire()
|
||||
HandleToBeQueued()
|
||||
|
||||
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(inbounds)
|
||||
name = "Inbounds"
|
||||
priority = 40
|
||||
flags = SS_NO_INIT
|
||||
runlevels = RUNLEVEL_GAME
|
||||
|
||||
var/list/processing = list()
|
||||
var/list/currentrun = list()
|
||||
|
||||
@@ -287,8 +287,6 @@ SUBSYSTEM_DEF(job)
|
||||
if(PopcapReached())
|
||||
RejectPlayer(player)
|
||||
|
||||
var/datum/job/validjob
|
||||
|
||||
// Loop through all jobs
|
||||
for(var/datum/job/job in shuffledoccupations) // SHUFFLE ME BABY
|
||||
if(!job)
|
||||
@@ -315,19 +313,11 @@ SUBSYSTEM_DEF(job)
|
||||
|
||||
// If the job isn't filled
|
||||
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
|
||||
Debug("DO pass, Player: [player], Level:[level], Job:[job.title]")
|
||||
AssignRole(player, job.title)
|
||||
unassigned -= player
|
||||
break
|
||||
|
||||
validjob = job
|
||||
|
||||
//Is the Job empty? Stop Looking Then!
|
||||
if (!job.current_positions)
|
||||
break
|
||||
|
||||
//Assign us the last job we found
|
||||
if (validjob)
|
||||
Debug("DO pass, Player: [player], Level:[level], Job:[validjob.title]")
|
||||
AssignRole(player, validjob.title)
|
||||
unassigned -= player
|
||||
break
|
||||
|
||||
// Hand out random jobs to the people who didn't get any in the last check
|
||||
// Also makes sure that they got their preference correct
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
SUBSYSTEM_DEF(language)
|
||||
name = "Language"
|
||||
init_order = INIT_ORDER_LANGUAGE
|
||||
flags = SS_NO_FIRE
|
||||
|
||||
/datum/controller/subsystem/language/Initialize(timeofday)
|
||||
for(var/L in subtypesof(/datum/language))
|
||||
var/datum/language/language = L
|
||||
if(!initial(language.key))
|
||||
continue
|
||||
|
||||
GLOB.all_languages += language
|
||||
|
||||
var/datum/language/instance = new language
|
||||
|
||||
GLOB.language_datum_instances[language] = instance
|
||||
|
||||
return ..()
|
||||
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(mobs)
|
||||
name = "Mobs"
|
||||
priority = 100
|
||||
flags = SS_KEEP_TIMING|SS_NO_INIT
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/currentrun = list()
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ SUBSYSTEM_DEF(npcpool)
|
||||
name = "NPC Pool"
|
||||
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
|
||||
priority = 20
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/canBeUsed = list()
|
||||
var/list/needsDelegate = list()
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
SUBSYSTEM_DEF(parallax)
|
||||
name = "Parallax"
|
||||
wait = 2
|
||||
flags = SS_POST_FIRE_TIMING | SS_FIRE_IN_LOBBY | SS_BACKGROUND | SS_NO_INIT
|
||||
flags = SS_POST_FIRE_TIMING | SS_BACKGROUND | SS_NO_INIT
|
||||
priority = 65
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
var/list/currentrun
|
||||
|
||||
/datum/controller/subsystem/parallax/fire(resumed = 0)
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
PROCESSING_SUBSYSTEM_DEF(overlays)
|
||||
name = "Overlay"
|
||||
flags = SS_TICKER|SS_FIRE_IN_LOBBY
|
||||
flags = SS_TICKER
|
||||
wait = 1
|
||||
priority = 500
|
||||
init_order = INIT_ORDER_OVERLAY
|
||||
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_SETUP
|
||||
|
||||
stat_tag = "Ov"
|
||||
currentrun = null
|
||||
|
||||
@@ -3,8 +3,9 @@
|
||||
SUBSYSTEM_DEF(server_maint)
|
||||
name = "Server Tasks"
|
||||
wait = 6
|
||||
flags = SS_POST_FIRE_TIMING|SS_FIRE_IN_LOBBY
|
||||
flags = SS_POST_FIRE_TIMING
|
||||
priority = 10
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
var/list/currentrun
|
||||
|
||||
/datum/controller/subsystem/server_maint/Initialize(timeofday)
|
||||
|
||||
@@ -5,6 +5,7 @@ SUBSYSTEM_DEF(shuttle)
|
||||
wait = 10
|
||||
init_order = INIT_ORDER_SHUTTLE
|
||||
flags = SS_KEEP_TIMING|SS_NO_TICK_CHECK
|
||||
runlevels = RUNLEVEL_SETUP | RUNLEVEL_GAME
|
||||
|
||||
var/list/mobile = list()
|
||||
var/list/stationary = list()
|
||||
@@ -48,7 +49,7 @@ SUBSYSTEM_DEF(shuttle)
|
||||
var/auto_call = 72000 //time before in deciseconds in which the shuttle is auto called. Default is 2 hours.
|
||||
|
||||
/datum/controller/subsystem/shuttle/Initialize(timeofday)
|
||||
if(!emergency)
|
||||
if(!arrivals)
|
||||
WARNING("No /obj/docking_port/mobile/arrivals placed on the map!")
|
||||
if(!emergency)
|
||||
WARNING("No /obj/docking_port/mobile/emergency placed on the map!")
|
||||
@@ -513,3 +514,13 @@ SUBSYSTEM_DEF(shuttle)
|
||||
centcom_message = SSshuttle.centcom_message
|
||||
ordernum = SSshuttle.ordernum
|
||||
points = SSshuttle.points
|
||||
|
||||
|
||||
/datum/controller/subsystem/shuttle/proc/is_in_shuttle_bounds(atom/A)
|
||||
var/area/current = get_area(A)
|
||||
if(istype(current, /area/shuttle) && !istype(current,/area/shuttle/transit))
|
||||
return TRUE
|
||||
for(var/obj/docking_port/mobile/M in mobile)
|
||||
if(M.is_in_shuttle_bounds(A))
|
||||
return TRUE
|
||||
|
||||
@@ -3,6 +3,7 @@ SUBSYSTEM_DEF(spacedrift)
|
||||
priority = 30
|
||||
wait = 5
|
||||
flags = SS_NO_INIT|SS_KEEP_TIMING
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
SUBSYSTEM_DEF(tgui)
|
||||
name = "tgui"
|
||||
wait = 9
|
||||
flags = SS_NO_INIT|SS_FIRE_IN_LOBBY
|
||||
flags = SS_NO_INIT
|
||||
priority = 110
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
|
||||
var/list/currentrun = list()
|
||||
var/list/open_uis = list() // A list of open UIs, grouped by src_object and ui_key.
|
||||
|
||||
@@ -6,6 +6,7 @@ SUBSYSTEM_DEF(throwing)
|
||||
priority = 25
|
||||
wait = 1
|
||||
flags = SS_NO_INIT|SS_KEEP_TIMING|SS_TICKER
|
||||
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||
|
||||
var/list/currentrun
|
||||
var/list/processing = list()
|
||||
|
||||
@@ -5,7 +5,8 @@ SUBSYSTEM_DEF(ticker)
|
||||
init_order = INIT_ORDER_TICKER
|
||||
|
||||
priority = 200
|
||||
flags = SS_FIRE_IN_LOBBY|SS_KEEP_TIMING
|
||||
flags = SS_KEEP_TIMING
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVEL_SETUP | RUNLEVEL_GAME
|
||||
|
||||
var/current_state = GAME_STATE_STARTUP //state of current round (used by process()) Use the defines GAME_STATE_* !
|
||||
var/force_ending = 0 //Round was ended by admin intervention
|
||||
@@ -109,6 +110,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
if(timeLeft <= 0)
|
||||
current_state = GAME_STATE_SETTING_UP
|
||||
Master.SetRunLevel(RUNLEVEL_SETUP)
|
||||
if(start_immediately)
|
||||
fire()
|
||||
|
||||
@@ -116,6 +118,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
if(!setup())
|
||||
//setup failed
|
||||
current_state = GAME_STATE_STARTUP
|
||||
Master.SetRunLevel(RUNLEVEL_LOBBY)
|
||||
|
||||
if(GAME_STATE_PLAYING)
|
||||
mode.process(wait * 0.1)
|
||||
@@ -128,6 +131,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
current_state = GAME_STATE_FINISHED
|
||||
toggle_ooc(1) // Turn it on
|
||||
declare_completion(force_ending)
|
||||
Master.SetRunLevel(RUNLEVEL_POSTGAME)
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/setup()
|
||||
to_chat(world, "<span class='boldannounce'>Starting game...</span>")
|
||||
@@ -204,8 +208,6 @@ SUBSYSTEM_DEF(ticker)
|
||||
|
||||
transfer_characters() //transfer keys to the new mobs
|
||||
|
||||
Master.RoundStart() //let the party begin...
|
||||
|
||||
for(var/I in round_start_events)
|
||||
var/datum/callback/cb = I
|
||||
cb.InvokeAsync()
|
||||
@@ -218,6 +220,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
world << sound('sound/AI/welcome.ogg')
|
||||
|
||||
current_state = GAME_STATE_PLAYING
|
||||
Master.SetRunLevel(RUNLEVEL_GAME)
|
||||
|
||||
if(SSevents.holidays)
|
||||
to_chat(world, "<font color='blue'>and...</font>")
|
||||
@@ -281,7 +284,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
//Now animate the cinematic
|
||||
switch(station_missed)
|
||||
if(NUKE_NEAR_MISS) //nuke was nearby but (mostly) missed
|
||||
if( mode && !override )
|
||||
if(mode && !override )
|
||||
override = mode.name
|
||||
switch( override )
|
||||
if("nuclear emergency") //Nuke wasn't on station when it blew up
|
||||
@@ -291,6 +294,17 @@ SUBSYSTEM_DEF(ticker)
|
||||
station_explosion_detonation(bomb)
|
||||
flick("station_intact_fade_red",cinematic)
|
||||
cinematic.icon_state = "summary_nukefail"
|
||||
if("cult")
|
||||
cinematic.icon_state = null
|
||||
flick("intro_cult",cinematic)
|
||||
sleep(25)
|
||||
world << sound('sound/magic/enter_blood.ogg')
|
||||
sleep(28)
|
||||
world << sound('sound/machines/terminal_off.ogg')
|
||||
sleep(20)
|
||||
flick("station_corrupted",cinematic)
|
||||
world << sound('sound/effects/ghost.ogg')
|
||||
actually_blew_up = FALSE
|
||||
if("gang war") //Gang Domination (just show the override screen)
|
||||
cinematic.icon_state = "intro_malf_still"
|
||||
flick("intro_malf",cinematic)
|
||||
@@ -339,6 +353,13 @@ SUBSYSTEM_DEF(ticker)
|
||||
world << sound('sound/effects/explosionfar.ogg')
|
||||
station_explosion_detonation(bomb) //TODO: no idea what this case could be
|
||||
cinematic.icon_state = "summary_selfdes"
|
||||
if("cult") //Station nuked (nuke,explosion,summary)
|
||||
flick("intro_nuke",cinematic)
|
||||
sleep(35)
|
||||
flick("station_explode_fade_red",cinematic)
|
||||
world << sound('sound/effects/explosionfar.ogg')
|
||||
station_explosion_detonation(bomb) //TODO: no idea what this case could be
|
||||
cinematic.icon_state = "summary_cult"
|
||||
if("no_core") //Nuke failed to detonate as it had no core
|
||||
flick("intro_nuke",cinematic)
|
||||
sleep(35)
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
SUBSYSTEM_DEF(time_track)
|
||||
name = "Time Tracking"
|
||||
wait = 600
|
||||
flags = SS_NO_INIT|SS_FIRE_IN_LOBBY|SS_NO_TICK_CHECK
|
||||
flags = SS_NO_INIT|SS_NO_TICK_CHECK
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
|
||||
var/time_dilation_current = 0
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ SUBSYSTEM_DEF(timer)
|
||||
wait = 1 //SS_TICKER subsystem, so wait is in ticks
|
||||
init_order = INIT_ORDER_TIMER
|
||||
|
||||
flags = SS_FIRE_IN_LOBBY|SS_TICKER|SS_NO_INIT
|
||||
flags = SS_TICKER|SS_NO_INIT
|
||||
|
||||
var/list/datum/timedevent/processing = list()
|
||||
var/list/hashes = list()
|
||||
|
||||
@@ -2,7 +2,9 @@ SUBSYSTEM_DEF(vote)
|
||||
name = "Vote"
|
||||
wait = 10
|
||||
|
||||
flags = SS_FIRE_IN_LOBBY|SS_KEEP_TIMING|SS_NO_INIT
|
||||
flags = SS_KEEP_TIMING|SS_NO_INIT
|
||||
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||
|
||||
var/initiator = null
|
||||
var/started_time = null
|
||||
|
||||
@@ -3,6 +3,7 @@ SUBSYSTEM_DEF(weather)
|
||||
name = "Weather"
|
||||
flags = SS_BACKGROUND
|
||||
wait = 10
|
||||
runlevels = RUNLEVEL_GAME
|
||||
var/list/processing = list()
|
||||
var/list/existing_weather = list()
|
||||
var/list/eligible_zlevels = list(ZLEVEL_LAVALAND)
|
||||
|
||||
+57
-3
@@ -358,6 +358,59 @@
|
||||
active = FALSE
|
||||
..()
|
||||
|
||||
/datum/action/item_action/initialize_ninja_suit
|
||||
name = "Toggle ninja suit"
|
||||
|
||||
/datum/action/item_action/ninjajaunt
|
||||
name = "Phase Jaunt (10E)"
|
||||
desc = "Utilizes the internal VOID-shift device to rapidly transit in direction facing."
|
||||
button_icon_state = "ninja_phase"
|
||||
|
||||
/datum/action/item_action/ninjasmoke
|
||||
name = "Smoke Bomb"
|
||||
desc = "Blind your enemies momentarily with a well-placed smoke bomb."
|
||||
button_icon_state = "smoke"
|
||||
|
||||
/datum/action/item_action/ninjaboost
|
||||
name = "Adrenaline Boost"
|
||||
desc = "Inject a secret chemical that will counteract all movement-impairing effect."
|
||||
button_icon_state = "repulse"
|
||||
|
||||
/datum/action/item_action/ninjapulse
|
||||
name = "EM Burst (25E)"
|
||||
desc = "Disable any nearby technology with a electro-magnetic pulse."
|
||||
button_icon_state = "emp"
|
||||
|
||||
/datum/action/item_action/ninjastar
|
||||
name = "Create Throwing Stars (1E)"
|
||||
desc = "Creates some throwing stars"
|
||||
button_icon_state = "throwingstar"
|
||||
icon_icon = 'icons/obj/weapons.dmi'
|
||||
|
||||
/datum/action/item_action/ninjanet
|
||||
name = "Energy Net (20E)"
|
||||
desc = "Captures a fallen opponent in a net of energy. Will teleport them to a holding facility after 30 seconds."
|
||||
button_icon_state = "energynet"
|
||||
icon_icon = 'icons/effects/effects.dmi'
|
||||
|
||||
/datum/action/item_action/ninja_sword_recall
|
||||
name = "Recall Energy Katana (Variable Cost)"
|
||||
desc = "Teleports the Energy Katana linked to this suit to its wearer, cost based on distance."
|
||||
button_icon_state = "energy_katana"
|
||||
icon_icon = 'icons/obj/weapons.dmi'
|
||||
|
||||
/datum/action/item_action/ninja_stealth
|
||||
name = "Toggle Stealth"
|
||||
desc = "Toggles stealth mode on and off."
|
||||
button_icon_state = "ninja_cloak"
|
||||
|
||||
/datum/action/item_action/toggle_glove
|
||||
name = "Toggle interaction"
|
||||
desc = "Switch between normal interaction and drain mode."
|
||||
button_icon_state = "s-ninjan"
|
||||
icon_icon = 'icons/obj/clothing/gloves.dmi'
|
||||
|
||||
|
||||
/datum/action/item_action/organ_action
|
||||
check_flags = AB_CHECK_CONSCIOUS
|
||||
|
||||
@@ -482,6 +535,7 @@
|
||||
/datum/action/language_menu/Trigger()
|
||||
if(!..())
|
||||
return FALSE
|
||||
if(isliving(owner))
|
||||
var/mob/living/L = owner
|
||||
L.open_language_menu(usr)
|
||||
if(ismob(owner))
|
||||
var/mob/M = owner
|
||||
var/datum/language_holder/H = M.get_language_holder()
|
||||
H.open_language_menu(usr)
|
||||
|
||||
@@ -420,7 +420,7 @@
|
||||
return
|
||||
|
||||
/datum/ai_laws/proc/clear_law_sixsixsix(force)
|
||||
if(force || !(owner && owner.mind.devilinfo))
|
||||
if(force || !is_devil(owner))
|
||||
devillaws = null
|
||||
|
||||
/datum/ai_laws/proc/associate(mob/living/silicon/M)
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
var/can_coexist_with_others = TRUE //Whether or not the person will be able to have more than one datum
|
||||
var/list/typecache_datum_blacklist = list() //List of datums this type can't coexist with
|
||||
var/delete_on_death = TRUE
|
||||
|
||||
/datum/antagonist/New(datum/mind/new_owner)
|
||||
typecache_datum_blacklist = typecacheof(typecache_datum_blacklist)
|
||||
@@ -59,4 +60,4 @@
|
||||
return
|
||||
|
||||
/datum/antagonist/proc/farewell()
|
||||
return
|
||||
return
|
||||
@@ -1,10 +1,58 @@
|
||||
/datum/antagonist/cult
|
||||
var/datum/action/innate/cultcomm/communion = new
|
||||
var/datum/action/innate/cult/comm/communion = new
|
||||
var/datum/action/innate/cult/mastervote/vote = new
|
||||
|
||||
/datum/antagonist/cult/Destroy()
|
||||
qdel(communion)
|
||||
QDEL_NULL(communion)
|
||||
QDEL_NULL(vote)
|
||||
return ..()
|
||||
|
||||
/datum/antagonist/cult/proc/add_objectives()
|
||||
var/list/target_candidates = list()
|
||||
for(var/mob/living/carbon/human/player in GLOB.player_list)
|
||||
if(player.mind && !player.mind.has_antag_datum(ANTAG_DATUM_CULT) && !is_convertable_to_cult(player) && (player != owner) && player.stat != DEAD)
|
||||
target_candidates += player.mind
|
||||
if(target_candidates.len == 0)
|
||||
message_admins("Cult Sacrifice: Could not find unconvertable target, checking for convertable target.")
|
||||
for(var/mob/living/carbon/human/player in GLOB.player_list)
|
||||
if(player.mind && !player.mind.has_antag_datum(ANTAG_DATUM_CULT) && (player != owner) && player.stat != DEAD)
|
||||
target_candidates += player.mind
|
||||
listclearnulls(target_candidates)
|
||||
if(LAZYLEN(target_candidates))
|
||||
GLOB.sac_mind = pick(target_candidates)
|
||||
if(!GLOB.sac_mind)
|
||||
message_admins("Cult Sacrifice: ERROR - Null target chosen!")
|
||||
else
|
||||
var/datum/job/sacjob = SSjob.GetJob(GLOB.sac_mind.assigned_role)
|
||||
var/datum/preferences/sacface = GLOB.sac_mind.current.client.prefs
|
||||
var/icon/reshape = get_flat_human_icon(null, sacjob, sacface)
|
||||
reshape.Shift(SOUTH, 4)
|
||||
reshape.Shift(EAST, 1)
|
||||
reshape.Crop(7,4,26,31)
|
||||
reshape.Crop(-5,-3,26,30)
|
||||
GLOB.sac_image = reshape
|
||||
else
|
||||
message_admins("Cult Sacrifice: Could not find unconvertable or convertable target. WELP!")
|
||||
GLOB.sac_complete = TRUE
|
||||
SSticker.mode.cult_objectives += "sacrifice"
|
||||
SSticker.mode.cult_objectives += "eldergod"
|
||||
|
||||
/datum/antagonist/cult/proc/cult_memorization(datum/mind/cult_mind)
|
||||
var/mob/living/current = cult_mind.current
|
||||
for(var/obj_count = 1,obj_count <= SSticker.mode.cult_objectives.len,obj_count++)
|
||||
var/explanation
|
||||
switch(SSticker.mode.cult_objectives[obj_count])
|
||||
if("sacrifice")
|
||||
if(GLOB.sac_mind)
|
||||
explanation = "Sacrifice [GLOB.sac_mind], the [GLOB.sac_mind.assigned_role] via invoking a Sacrifice rune with them on it and three acolytes around it."
|
||||
else
|
||||
explanation = "The veil has already been weakened here, proceed to the final objective."
|
||||
if("eldergod")
|
||||
explanation = "Summon Nar-Sie by invoking the rune 'Summon Nar-Sie' with nine acolytes on it. You must do this after sacrificing your target."
|
||||
if(!silent)
|
||||
to_chat(current, "<B>Objective #[obj_count]</B>: [explanation]")
|
||||
cult_mind.memory += "<B>Objective #[obj_count]</B>: [explanation]<BR>"
|
||||
|
||||
/datum/antagonist/cult/can_be_owned(datum/mind/new_owner)
|
||||
. = ..()
|
||||
if(.)
|
||||
@@ -12,14 +60,17 @@
|
||||
|
||||
/datum/antagonist/cult/on_gain()
|
||||
. = ..()
|
||||
SSticker.mode.cult += owner
|
||||
var/mob/living/current = owner.current
|
||||
if(!LAZYLEN(SSticker.mode.cult_objectives))
|
||||
add_objectives()
|
||||
SSticker.mode.cult += owner // Only add after they've been given objectives
|
||||
cult_memorization(owner)
|
||||
if(jobban_isbanned(current, ROLE_CULTIST))
|
||||
addtimer(CALLBACK(SSticker.mode, /datum/game_mode.proc/replace_jobbaned_player, current, ROLE_CULTIST, ROLE_CULTIST), 0)
|
||||
SSticker.mode.update_cult_icons_added(owner)
|
||||
if(istype(SSticker.mode, /datum/game_mode/cult))
|
||||
var/datum/game_mode/cult/C = SSticker.mode
|
||||
C.memorize_cult_objectives(owner)
|
||||
if(jobban_isbanned(owner.current, ROLE_CULTIST))
|
||||
addtimer(CALLBACK(SSticker.mode, /datum/game_mode.proc/replace_jobbaned_player, owner.current, ROLE_CULTIST, ROLE_CULTIST), 0)
|
||||
owner.current.log_message("<font color=#960000>Has been converted to the cult of Nar'Sie!</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
current.log_message("<font color=#960000>Has been converted to the cult of Nar'Sie!</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
if(GLOB.blood_target && GLOB.blood_target_image && current.client)
|
||||
current.client.images += GLOB.blood_target_image
|
||||
|
||||
/datum/antagonist/cult/apply_innate_effects(mob/living/mob_override)
|
||||
. = ..()
|
||||
@@ -27,8 +78,12 @@
|
||||
if(mob_override)
|
||||
current = mob_override
|
||||
current.faction |= "cult"
|
||||
current.grant_language(/datum/language/narsie)
|
||||
current.verbs += /mob/living/proc/cult_help
|
||||
if(!GLOB.cult_mastered)
|
||||
vote.Grant(current)
|
||||
communion.Grant(current)
|
||||
current.throw_alert("bloodsense", /obj/screen/alert/bloodsense)
|
||||
|
||||
/datum/antagonist/cult/remove_innate_effects(mob/living/mob_override)
|
||||
. = ..()
|
||||
@@ -36,15 +91,60 @@
|
||||
if(mob_override)
|
||||
current = mob_override
|
||||
current.faction -= "cult"
|
||||
current.remove_language(/datum/language/narsie)
|
||||
current.verbs -= /mob/living/proc/cult_help
|
||||
vote.Remove(current)
|
||||
communion.Remove(current)
|
||||
current.clear_alert("bloodsense")
|
||||
|
||||
/datum/antagonist/cult/on_removal()
|
||||
owner.wipe_memory()
|
||||
SSticker.mode.cult -= owner
|
||||
SSticker.mode.update_cult_icons_removed(owner)
|
||||
to_chat(owner, "<span class='userdanger'>An unfamiliar white light flashes through your mind, cleansing the taint of the Dark One and all your memories as its servant.</span>")
|
||||
owner.current.log_message("<font color=#960000>Has renounced the cult of Nar'Sie!</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
if(!silent)
|
||||
owner.current.visible_message("<span class='big'>[owner] looks like [owner.current.p_they()] just reverted to their old faith!</span>")
|
||||
to_chat(owner.current, "<span class='userdanger'>An unfamiliar white light flashes through your mind, cleansing the taint of the Geometer and all your memories as her servant.</span>")
|
||||
owner.current.log_message("<font color=#960000>Has renounced the cult of Nar'Sie!</font>", INDIVIDUAL_ATTACK_LOG)
|
||||
owner.current.visible_message("<span class='big'>[owner.current] looks like [owner.current.p_they()] just reverted to their old faith!</span>")
|
||||
if(GLOB.blood_target && GLOB.blood_target_image && owner.current.client)
|
||||
owner.current.client.images -= GLOB.blood_target_image
|
||||
. = ..()
|
||||
|
||||
/datum/antagonist/cult/master
|
||||
var/datum/action/innate/cult/master/finalreck/reckoning = new
|
||||
var/datum/action/innate/cult/master/cultmark/bloodmark = new
|
||||
|
||||
/datum/antagonist/cult/master/Destroy()
|
||||
QDEL_NULL(reckoning)
|
||||
QDEL_NULL(bloodmark)
|
||||
return ..()
|
||||
|
||||
/datum/antagonist/cult/master/on_gain()
|
||||
. = ..()
|
||||
var/mob/living/current = owner.current
|
||||
SSticker.mode.set_antag_hud(current, "cultmaster")
|
||||
|
||||
/datum/antagonist/cult/master/greet()
|
||||
to_chat(owner.current, "<span class='cultlarge'>You are the cult's Master</span>. As the cult's Master, you have a unique title and loud voice when communicating, are capable of marking \
|
||||
targets, such as a location or a noncultist, to direct the cult to them, and, finally, you are capable of summoning the entire living cult to your location <b><i>once</i></b>.")
|
||||
to_chat(owner.current, "Use these abilities to direct the cult to victory at any cost.")
|
||||
|
||||
/datum/antagonist/cult/master/apply_innate_effects(mob/living/mob_override)
|
||||
. = ..()
|
||||
var/mob/living/current = owner.current
|
||||
if(mob_override)
|
||||
current = mob_override
|
||||
if(!GLOB.reckoning_complete)
|
||||
reckoning.Grant(current)
|
||||
bloodmark.Grant(current)
|
||||
current.update_action_buttons_icon()
|
||||
current.apply_status_effect(/datum/status_effect/cult_master)
|
||||
|
||||
/datum/antagonist/cult/master/remove_innate_effects(mob/living/mob_override)
|
||||
. = ..()
|
||||
var/mob/living/current = owner.current
|
||||
if(mob_override)
|
||||
current = mob_override
|
||||
reckoning.Remove(current)
|
||||
bloodmark.Remove(current)
|
||||
current.update_action_buttons_icon()
|
||||
current.remove_status_effect(/datum/status_effect/cult_master)
|
||||
@@ -0,0 +1,153 @@
|
||||
/datum/antagonist/ninja
|
||||
name = "Ninja"
|
||||
var/team
|
||||
var/helping_station = 0
|
||||
var/give_objectives = TRUE
|
||||
|
||||
/datum/antagonist/ninja/friendly
|
||||
helping_station = 1
|
||||
|
||||
/datum/antagonist/ninja/friendly/noobjective
|
||||
give_objectives = FALSE
|
||||
|
||||
/datum/antagonist/ninja/New(datum/mind/new_owner)
|
||||
if(new_owner && !ishuman(new_owner.current))//It's fine if we aren't passed a mind, but if we are, they have to be human.
|
||||
throw EXCEPTION("Only humans and/or humanoids may be ninja'ed")
|
||||
..(new_owner)
|
||||
|
||||
/datum/antagonist/ninja/randomAllegiance/New(datum/mind/new_owner)
|
||||
..(new_owner)
|
||||
helping_station = rand(0,1)
|
||||
|
||||
/datum/antagonist/ninja/proc/equip_space_ninja(mob/living/carbon/human/H = owner.current, safety=0)//Safety in case you need to unequip stuff for existing characters.
|
||||
if(safety)
|
||||
qdel(H.w_uniform)
|
||||
qdel(H.wear_suit)
|
||||
qdel(H.wear_mask)
|
||||
qdel(H.head)
|
||||
qdel(H.shoes)
|
||||
qdel(H.gloves)
|
||||
|
||||
var/obj/item/clothing/suit/space/space_ninja/theSuit = new(H)
|
||||
var/obj/item/weapon/katana/energy/EK = new(H)
|
||||
theSuit.energyKatana = EK
|
||||
|
||||
H.equip_to_slot_or_del(new /obj/item/device/radio/headset(H), slot_ears)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/black(H), slot_w_uniform)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/space_ninja(H), slot_shoes)
|
||||
H.equip_to_slot_or_del(theSuit, slot_wear_suit)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/gloves/space_ninja(H), slot_gloves)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/space_ninja(H), slot_head)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/space_ninja(H), slot_wear_mask)
|
||||
H.equip_to_slot_or_del(new /obj/item/clothing/glasses/night(H), slot_glasses)
|
||||
H.equip_to_slot_or_del(EK, slot_belt)
|
||||
H.equip_to_slot_or_del(new /obj/item/device/flashlight(H), slot_r_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/grenade/plastic/x4(H), slot_l_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/tank/internals/emergency_oxygen(H), slot_s_store)
|
||||
H.equip_to_slot_or_del(new /obj/item/weapon/tank/jetpack/carbondioxide(H), slot_back)
|
||||
theSuit.randomize_param()
|
||||
|
||||
var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(H)
|
||||
E.implant(H)
|
||||
return 1
|
||||
|
||||
/datum/antagonist/ninja/proc/addMemories()
|
||||
owner.store_memory("I am an elite mercenary assassin of the mighty Spider Clan. A <font color='red'><B>SPACE NINJA</B></font>!")
|
||||
owner.store_memory("Surprise is my weapon. Shadows are my armor. Without them, I am nothing. (//initialize your suit by right clicking on it, to use abilities like stealth)!")
|
||||
owner.store_memory("Officially, [helping_station?"Nanotrasen":"The Syndicate"] are my employer.")
|
||||
|
||||
/datum/antagonist/ninja/proc/addObjectives(quantity = 6)
|
||||
var/list/possible_targets = list()
|
||||
for(var/datum/mind/M in SSticker.minds)
|
||||
if(M.current && M.current.stat != DEAD)
|
||||
if(ishuman(M.current))
|
||||
if(M.special_role)
|
||||
possible_targets[M] = 0 //bad-guy
|
||||
else if(M.assigned_role in GLOB.command_positions)
|
||||
possible_targets[M] = 1 //good-guy
|
||||
|
||||
var/list/objectives = list(1,2,3,4)
|
||||
while(owner.objectives.len < quantity)
|
||||
switch(pick_n_take(objectives))
|
||||
if(1) //research
|
||||
var/datum/objective/download/O = new /datum/objective/download()
|
||||
O.owner = owner
|
||||
O.gen_amount_goal()
|
||||
owner.objectives += O
|
||||
|
||||
if(2) //steal
|
||||
var/datum/objective/steal/special/O = new /datum/objective/steal/special()
|
||||
O.owner = owner
|
||||
owner.objectives += O
|
||||
|
||||
if(3) //protect/kill
|
||||
if(!possible_targets.len) continue
|
||||
var/index = rand(1,possible_targets.len)
|
||||
var/datum/mind/M = possible_targets[index]
|
||||
var/is_bad_guy = possible_targets[M]
|
||||
possible_targets.Cut(index,index+1)
|
||||
|
||||
if(is_bad_guy ^ helping_station) //kill (good-ninja + bad-guy or bad-ninja + good-guy)
|
||||
var/datum/objective/assassinate/O = new /datum/objective/assassinate()
|
||||
O.owner = owner
|
||||
O.target = M
|
||||
O.explanation_text = "Slay \the [M.current.real_name], the [M.assigned_role]."
|
||||
owner.objectives += O
|
||||
else //protect
|
||||
var/datum/objective/protect/O = new /datum/objective/protect()
|
||||
O.owner = owner
|
||||
O.target = M
|
||||
O.explanation_text = "Protect \the [M.current.real_name], the [M.assigned_role], from harm."
|
||||
owner.objectives += O
|
||||
if(4) //debrain/capture
|
||||
if(!possible_targets.len) continue
|
||||
var/selected = rand(1,possible_targets.len)
|
||||
var/datum/mind/M = possible_targets[selected]
|
||||
var/is_bad_guy = possible_targets[M]
|
||||
possible_targets.Cut(selected,selected+1)
|
||||
|
||||
if(is_bad_guy ^ helping_station) //debrain (good-ninja + bad-guy or bad-ninja + good-guy)
|
||||
var/datum/objective/debrain/O = new /datum/objective/debrain()
|
||||
O.owner = owner
|
||||
O.target = M
|
||||
O.explanation_text = "Steal the brain of [M.current.real_name]."
|
||||
owner.objectives += O
|
||||
else //capture
|
||||
var/datum/objective/capture/O = new /datum/objective/capture()
|
||||
O.owner = owner
|
||||
O.gen_amount_goal()
|
||||
owner.objectives += O
|
||||
else
|
||||
break
|
||||
var/datum/objective/O = new /datum/objective/survive()
|
||||
O.owner = owner
|
||||
owner.objectives += O
|
||||
|
||||
|
||||
/proc/remove_ninja(mob/living/L)
|
||||
if(!L || !L.mind)
|
||||
return FALSE
|
||||
var/datum/antagonist/datum = L.mind.has_antag_datum(ANTAG_DATUM_NINJA)
|
||||
datum.on_removal()
|
||||
return TRUE
|
||||
|
||||
/proc/add_ninja(mob/living/carbon/human/H, type = ANTAG_DATUM_NINJA_RANDOM)
|
||||
if(!H || !H.mind)
|
||||
return FALSE
|
||||
return H.mind.add_antag_datum(type)
|
||||
|
||||
/proc/is_ninja(mob/living/M)
|
||||
return M && M.mind && M.mind.has_antag_datum(ANTAG_DATUM_NINJA)
|
||||
|
||||
|
||||
/datum/antagonist/ninja/greet()
|
||||
owner.current << sound('sound/effects/ninja_greeting.ogg')
|
||||
to_chat(owner.current, "I am an elite mercenary assassin of the mighty Spider Clan. A <font color='red'><B>SPACE NINJA</B></font>!")
|
||||
to_chat(owner.current, "Surprise is my weapon. Shadows are my armor. Without them, I am nothing. (//initialize your suit by right clicking on it, to use abilities like stealth)!")
|
||||
to_chat(owner.current, "Officially, [helping_station?"Nanotrasen":"The Syndicate"] are my employer.")
|
||||
return
|
||||
|
||||
/datum/antagonist/ninja/on_gain()
|
||||
if(give_objectives)
|
||||
addObjectives()
|
||||
addMemories()
|
||||
@@ -169,7 +169,7 @@
|
||||
opentime = 0
|
||||
|
||||
/datum/browser/alert/proc/wait()
|
||||
while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout >= world.time))
|
||||
while (opentime && selectedbutton <= 0 && (!timeout || opentime+timeout > world.time))
|
||||
stoplag()
|
||||
|
||||
/datum/browser/alert/Topic(href,href_list)
|
||||
|
||||
@@ -737,18 +737,6 @@
|
||||
src.give_disease(M)
|
||||
href_list["datumrefresh"] = href_list["give_spell"]
|
||||
|
||||
else if(href_list["ninja"])
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
var/mob/M = locate(href_list["ninja"])
|
||||
if(!istype(M))
|
||||
to_chat(usr, "This can only be used on instances of type /mob")
|
||||
return
|
||||
|
||||
src.cmd_admin_ninjafy(M)
|
||||
href_list["datumrefresh"] = href_list["ninja"]
|
||||
|
||||
else if(href_list["gib"])
|
||||
if(!check_rights(R_FUN))
|
||||
return
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
|
||||
#define HOLOPAD_MAX_DIAL_TIME 200
|
||||
|
||||
/mob/camera/aiEye/remote/holo/setLoc()
|
||||
@@ -30,6 +31,7 @@
|
||||
var/obj/machinery/holopad/H = I
|
||||
if(!QDELETED(H) && H.is_operational())
|
||||
dialed_holopads += H
|
||||
H.say("Incoming call.")
|
||||
LAZYADD(H.holo_calls, src)
|
||||
|
||||
if(!dialed_holopads.len)
|
||||
@@ -41,12 +43,16 @@
|
||||
|
||||
//cleans up ALL references :)
|
||||
/datum/holocall/Destroy()
|
||||
QDEL_NULL(eye)
|
||||
|
||||
user.reset_perspective()
|
||||
if(user.client)
|
||||
for(var/datum/camerachunk/chunk in eye.visibleCameraChunks)
|
||||
user.client.images -= chunk.obscured
|
||||
user.remote_control = null
|
||||
QDEL_NULL(eye)
|
||||
|
||||
user = null
|
||||
hologram.HC = null
|
||||
if(hologram)
|
||||
hologram.HC = null
|
||||
hologram = null
|
||||
calling_holopad.outgoing_call = null
|
||||
|
||||
|
||||
+1600
-1578
File diff suppressed because it is too large
Load Diff
@@ -161,6 +161,12 @@
|
||||
description = "A small, but feature complete shuttle. It boasts a card table to keep crew members occupied on the long flight home."
|
||||
credit_cost = 1000
|
||||
|
||||
/datum/map_template/shuttle/emergency/cere
|
||||
suffix = "cere"
|
||||
name = "Cere Station Emergency Shuttle"
|
||||
description = "The large, beefed-up version of the box-standard shuttle. Includes an expanded brig, fully stocked medbay, enhanced cargo storage with mech chargers, \
|
||||
an engine room stocked with various supplies, and a crew capacity of 80+ to top it all off. Live large, live Cere."
|
||||
|
||||
/datum/map_template/shuttle/emergency/supermatter
|
||||
suffix = "supermatter"
|
||||
name = "Hyperfractal Gigashuttle"
|
||||
@@ -230,6 +236,10 @@
|
||||
suffix = "pubby"
|
||||
name = "NT White UFO"
|
||||
|
||||
/datum/map_template/shuttle/whiteship/cere
|
||||
suffix = "cere"
|
||||
name = "NT Construction Vessel"
|
||||
|
||||
/datum/map_template/shuttle/cargo/box
|
||||
suffix = "box"
|
||||
name = "supply shuttle (Box)"
|
||||
|
||||
@@ -108,6 +108,15 @@
|
||||
if(soulowner)
|
||||
soulowner.death(gibbed)
|
||||
|
||||
/////////////////
|
||||
// Demon Bind //
|
||||
/////////////////
|
||||
//When the soulowner dies, the soulsharer dies, but NOT vice versa
|
||||
//This is intended for two players(or AI) and two mobs
|
||||
|
||||
/datum/soullink/oneway/ownerDies(gibbed, mob/living/owner)
|
||||
if(soulsharer)
|
||||
soulsharer.dust(FALSE)
|
||||
|
||||
|
||||
/////////////////
|
||||
|
||||
@@ -228,3 +228,32 @@
|
||||
name = "Wish Granter's Immortality"
|
||||
desc = "You are being resurrected!"
|
||||
icon_state = "wish_granter"
|
||||
|
||||
/datum/status_effect/cult_master
|
||||
id = "The Cult Master"
|
||||
duration = -1
|
||||
tick_interval = 100
|
||||
alert_type = null
|
||||
var/alive = TRUE
|
||||
|
||||
/datum/status_effect/cult_master/proc/deathrattle()
|
||||
var/area/A = get_area(owner)
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
if(isliving(B.current))
|
||||
var/mob/living/M = B.current
|
||||
M << 'sound/hallucinations/veryfar_noise.ogg'
|
||||
to_chat(M, "<span class='cultlarge'>The Cult's Master, [owner], has fallen in the [A]!")
|
||||
|
||||
|
||||
/datum/status_effect/cult_master/tick()
|
||||
if(owner.stat != DEAD && !alive)
|
||||
alive = TRUE
|
||||
return
|
||||
if(owner.stat == DEAD && alive)
|
||||
alive = FALSE
|
||||
deathrattle()
|
||||
|
||||
/datum/status_effect/cult_master/on_remove()
|
||||
deathrattle()
|
||||
. = ..()
|
||||
|
||||
|
||||
@@ -162,3 +162,8 @@
|
||||
owner.confused = min(owner.confused + round(severity * 0.025, 1), 25) //2.5% of severity per second above 20 severity
|
||||
owner.adjustToxLoss(severity * 0.02, TRUE, TRUE) //2% of severity per second
|
||||
severity--
|
||||
|
||||
/datum/status_effect/cultghost //is a cult ghost and can't use manifest runes
|
||||
id = "cult_ghost"
|
||||
duration = -1
|
||||
alert_type = null
|
||||
@@ -1,75 +0,0 @@
|
||||
diff a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm (rejected hunks)
|
||||
@@ -108,20 +108,6 @@
|
||||
to_chat(owner, "<span class='sevtug[span_part]'>You feel a frustrated voice quietly fade from your mind...</span>")
|
||||
qdel(src)
|
||||
return
|
||||
- if(!(owner in viewers(7, motor))) //not being in range makes it fall off much faster
|
||||
- if(!is_servant && !warned_outofsight)
|
||||
- to_chat(owner, "<span class='sevtug[span_part]'>\"[text2ratvar(pick(flee_messages))]\"</span>")
|
||||
- warned_outofsight = TRUE
|
||||
- if(severity)
|
||||
- severity--
|
||||
- if(!severity)
|
||||
- qdel(src)
|
||||
- return
|
||||
- else
|
||||
- qdel(src)
|
||||
- return
|
||||
- else if(prob(severity * 2))
|
||||
- warned_outofsight = FALSE
|
||||
if(!motor.active) //it being off makes it fall off much faster
|
||||
if(!is_servant && !warned_turnoff)
|
||||
if(motor.total_accessable_power() > motor.mania_cost)
|
||||
@@ -129,20 +115,24 @@
|
||||
else
|
||||
to_chat(owner, "<span class='sevtug[span_part]'>[text2ratvar(pick(powerloss_messages))]</span>")
|
||||
warned_turnoff = TRUE
|
||||
- if(severity)
|
||||
- severity--
|
||||
+ severity = max(severity - 2, 0)
|
||||
+ if(!severity)
|
||||
+ qdel(src)
|
||||
+ return
|
||||
+ else
|
||||
+ if(prob(severity * 2))
|
||||
+ warned_turnoff = FALSE
|
||||
+ if(!(owner in viewers(7, motor))) //not being in range makes it fall off slightly faster
|
||||
+ if(!is_servant && !warned_outofsight)
|
||||
+ to_chat(owner, "<span class='sevtug[span_part]'>\"[text2ratvar(pick(flee_messages))]\"</span>")
|
||||
+ warned_outofsight = TRUE
|
||||
+ severity = max(severity - 1, 0)
|
||||
if(!severity)
|
||||
qdel(src)
|
||||
return
|
||||
- else
|
||||
- qdel(src)
|
||||
- return
|
||||
- else if(prob(severity * 2))
|
||||
- warned_turnoff = FALSE
|
||||
+ else if(prob(severity * 2))
|
||||
+ warned_outofsight = FALSE
|
||||
if(is_servant) //heals servants of braindamage, hallucination, druggy, dizziness, and confusion
|
||||
- var/brainloss = owner.getBrainLoss()
|
||||
- if(brainloss)
|
||||
- owner.adjustBrainLoss(-brainloss)
|
||||
if(owner.hallucination)
|
||||
owner.hallucination = 0
|
||||
if(owner.druggy)
|
||||
@@ -163,14 +153,12 @@
|
||||
if(prob(severity * 0.15))
|
||||
to_chat(owner, "<span class='sevtug[span_part]'>\"[text2ratvar(pick(mania_messages))]\"</span>")
|
||||
owner.playsound_local(get_turf(motor), hum, severity, 1)
|
||||
- if(owner.getBrainLoss() <= 50)
|
||||
- owner.adjustBrainLoss(severity * 0.025) //2.5% of severity per second
|
||||
owner.adjust_drugginess(Clamp(max(severity * 0.075, 1), 0, max(0, 50 - owner.druggy))) //7.5% of severity per second, minimum 1
|
||||
if(owner.hallucination < 50)
|
||||
owner.hallucination = min(owner.hallucination + max(severity * 0.075, 1), 50) //7.5% of severity per second, minimum 1
|
||||
- if(owner.dizziness < 25)
|
||||
- owner.dizziness = min(owner.dizziness + Floor(severity * 0.025), 25) //2.5% of severity per second above 20 severity
|
||||
+ if(owner.dizziness < 50)
|
||||
+ owner.dizziness = min(owner.dizziness + round(severity * 0.05, 1), 50) //5% of severity per second above 10 severity
|
||||
if(owner.confused < 25)
|
||||
- owner.confused = min(owner.confused + Floor(severity * 0.025), 25) //2.5% of severity per second above 20 severity
|
||||
+ owner.confused = min(owner.confused + round(severity * 0.025, 1), 25) //2.5% of severity per second above 20 severity
|
||||
owner.adjustToxLoss(severity * 0.02, TRUE, TRUE) //2% of severity per second
|
||||
severity--
|
||||
@@ -13,16 +13,16 @@
|
||||
|
||||
|
||||
/datum/wires/explosive/c4
|
||||
holder_type = /obj/item/weapon/c4
|
||||
holder_type = /obj/item/weapon/grenade/plastic/c4
|
||||
randomize = TRUE //Same behaviour since no wire actually disarms it
|
||||
|
||||
/datum/wires/explosive/c4/interactable(mob/user)
|
||||
var/obj/item/weapon/c4/P = holder
|
||||
var/obj/item/weapon/grenade/plastic/c4/P = holder
|
||||
if(P.open_panel)
|
||||
return TRUE
|
||||
|
||||
/datum/wires/explosive/c4/explode()
|
||||
var/obj/item/weapon/c4/P = holder
|
||||
var/obj/item/weapon/grenade/plastic/c4/P = holder
|
||||
P.explode()
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -43,7 +43,7 @@
|
||||
if(SSatoms.InitAtom(src, args))
|
||||
//we were deleted
|
||||
return
|
||||
|
||||
|
||||
var/list/created = SSatoms.created_atoms
|
||||
if(created)
|
||||
created += src
|
||||
|
||||
+79
-28
@@ -1,3 +1,4 @@
|
||||
|
||||
#ifndef PIXEL_SCALE
|
||||
#define PIXEL_SCALE 0
|
||||
#if DM_VERSION >= 512
|
||||
@@ -13,9 +14,8 @@
|
||||
var/throw_speed = 2 //How many tiles to move per ds when being thrown. Float values are fully supported
|
||||
var/throw_range = 7
|
||||
var/mob/pulledby = null
|
||||
var/list/languages
|
||||
var/list/initial_languages = list(/datum/language/common)
|
||||
var/only_speaks_language = null
|
||||
var/initial_language_holder = /datum/language_holder
|
||||
var/datum/language_holder/language_holder
|
||||
var/verb_say = "says"
|
||||
var/verb_ask = "asks"
|
||||
var/verb_exclaim = "exclaims"
|
||||
@@ -42,13 +42,32 @@
|
||||
return FALSE //PLEASE no.
|
||||
if((var_name in careful_edits) && (var_value % world.icon_size) != 0)
|
||||
return FALSE
|
||||
switch(var_name)
|
||||
if("x")
|
||||
var/turf/T = locate(var_value, y, z)
|
||||
if(T)
|
||||
forceMove(T)
|
||||
return TRUE
|
||||
return FALSE
|
||||
if("y")
|
||||
var/turf/T = locate(x, var_value, z)
|
||||
if(T)
|
||||
forceMove(T)
|
||||
return TRUE
|
||||
return FALSE
|
||||
if("z")
|
||||
var/turf/T = locate(x, y, var_value)
|
||||
if(T)
|
||||
forceMove(T)
|
||||
return TRUE
|
||||
return FALSE
|
||||
if("loc")
|
||||
if(var_value == null || istype(var_value, /atom))
|
||||
forceMove(var_value)
|
||||
return TRUE
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/atom/movable/Initialize(mapload)
|
||||
. = ..()
|
||||
for(var/L in initial_languages)
|
||||
grant_language(L)
|
||||
|
||||
/atom/movable/Move(atom/newloc, direct = 0)
|
||||
if(!loc || !newloc) return 0
|
||||
var/atom/oldloc = loc
|
||||
@@ -177,6 +196,7 @@
|
||||
STOP_PROCESSING(SSinbounds, src)
|
||||
|
||||
QDEL_NULL(proximity_monitor)
|
||||
QDEL_NULL(language_holder)
|
||||
|
||||
. = ..()
|
||||
if(loc)
|
||||
@@ -435,8 +455,7 @@
|
||||
pixel_x_diff = -8
|
||||
|
||||
animate(src, pixel_x = pixel_x + pixel_x_diff, pixel_y = pixel_y + pixel_y_diff, time = 2)
|
||||
//animate(pixel_x = initial(pixel_x), pixel_y = final_pixel_y, time = 2)
|
||||
animate(pixel_x = pixel_x - pixel_x_diff, pixel_y = final_pixel_y, time = 2) //Putting back my non offset breaking method
|
||||
animate(pixel_x = initial(pixel_x), pixel_y = final_pixel_y, time = 2)
|
||||
|
||||
/atom/movable/proc/do_item_attack_animation(atom/A, visual_effect_icon, obj/item/used_item)
|
||||
var/image/I
|
||||
@@ -576,44 +595,73 @@
|
||||
|
||||
|
||||
/* Language procs */
|
||||
/atom/movable/proc/get_language_holder(shadow=TRUE)
|
||||
if(language_holder)
|
||||
return language_holder
|
||||
else
|
||||
language_holder = new initial_language_holder(src)
|
||||
return language_holder
|
||||
|
||||
/atom/movable/proc/grant_language(datum/language/dt)
|
||||
LAZYINITLIST(languages)
|
||||
languages[dt] = TRUE
|
||||
var/datum/language_holder/H = get_language_holder()
|
||||
H.grant_language(dt)
|
||||
|
||||
/atom/movable/proc/grant_all_languages(omnitongue=FALSE)
|
||||
for(var/la in subtypesof(/datum/language))
|
||||
grant_language(la)
|
||||
|
||||
if(omnitongue)
|
||||
SET_SECONDARY_FLAG(src, OMNITONGUE)
|
||||
var/datum/language_holder/H = get_language_holder()
|
||||
H.grant_all_languages(omnitongue)
|
||||
|
||||
/atom/movable/proc/get_random_understood_language()
|
||||
var/list/possible = list()
|
||||
for(var/dt in languages)
|
||||
possible += dt
|
||||
. = safepick(possible)
|
||||
var/datum/language_holder/H = get_language_holder()
|
||||
. = H.get_random_understood_language()
|
||||
|
||||
/atom/movable/proc/remove_language(datum/language/dt)
|
||||
LAZYREMOVE(languages, dt)
|
||||
var/datum/language_holder/H = get_language_holder()
|
||||
H.remove_language(dt)
|
||||
|
||||
/atom/movable/proc/remove_all_languages()
|
||||
LAZYCLEARLIST(languages)
|
||||
var/datum/language_holder/H = get_language_holder()
|
||||
H.remove_all_languages()
|
||||
|
||||
/atom/movable/proc/has_language(datum/language/dt)
|
||||
. = is_type_in_typecache(dt, languages)
|
||||
var/datum/language_holder/H = get_language_holder()
|
||||
. = H.has_language(dt)
|
||||
|
||||
/atom/movable/proc/copy_known_languages_from(thing, replace=FALSE)
|
||||
var/datum/language_holder/H = get_language_holder()
|
||||
. = H.copy_known_languages_from(thing, replace)
|
||||
|
||||
// Whether an AM can speak in a language or not, independent of whether
|
||||
// it KNOWS the language
|
||||
/atom/movable/proc/could_speak_in_language(datum/language/dt)
|
||||
. = TRUE
|
||||
|
||||
/atom/movable/proc/can_speak_in_language(datum/language/dt)
|
||||
. = has_language(dt)
|
||||
if(only_speaks_language && !HAS_SECONDARY_FLAG(src, OMNITONGUE))
|
||||
. = . && ispath(only_speaks_language, dt)
|
||||
var/datum/language_holder/H = get_language_holder()
|
||||
|
||||
if(!H.has_language(dt))
|
||||
return FALSE
|
||||
else if(H.omnitongue)
|
||||
return TRUE
|
||||
else if(could_speak_in_language(dt) && (!H.only_speaks_language || H.only_speaks_language == dt))
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
/atom/movable/proc/get_default_language()
|
||||
// if no language is specified, and we want to say() something, which
|
||||
// language do we use?
|
||||
var/datum/language_holder/H = get_language_holder()
|
||||
|
||||
if(H.selected_default_language)
|
||||
if(can_speak_in_language(H.selected_default_language))
|
||||
return H.selected_default_language
|
||||
else
|
||||
H.selected_default_language = null
|
||||
|
||||
var/datum/language/chosen_langtype
|
||||
var/highest_priority
|
||||
|
||||
for(var/lt in languages)
|
||||
for(var/lt in H.languages)
|
||||
var/datum/language/langtype = lt
|
||||
if(!can_speak_in_language(langtype))
|
||||
continue
|
||||
@@ -623,7 +671,10 @@
|
||||
chosen_langtype = langtype
|
||||
highest_priority = pri
|
||||
|
||||
H.selected_default_language = .
|
||||
. = chosen_langtype
|
||||
|
||||
/* End language procs */
|
||||
/atom/movable/proc/ConveyorMove(movedir)
|
||||
set waitfor = FALSE
|
||||
if(!anchored && has_gravity())
|
||||
|
||||
@@ -1,295 +1,295 @@
|
||||
/obj/item/weapon/antag_spawner
|
||||
throw_speed = 1
|
||||
throw_range = 5
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/used = 0
|
||||
|
||||
/obj/item/weapon/antag_spawner/proc/spawn_antag(client/C, turf/T, type = "")
|
||||
return
|
||||
|
||||
/obj/item/weapon/antag_spawner/proc/equip_antag(mob/target)
|
||||
return
|
||||
|
||||
|
||||
///////////WIZARD
|
||||
|
||||
/obj/item/weapon/antag_spawner/contract
|
||||
name = "contract"
|
||||
desc = "A magic contract previously signed by an apprentice. In exchange for instruction in the magical arts, they are bound to answer your call for aid."
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state ="scroll2"
|
||||
|
||||
/obj/item/weapon/antag_spawner/contract/attack_self(mob/user)
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if(used)
|
||||
dat = "<B>You have already summoned your apprentice.</B><BR>"
|
||||
else
|
||||
dat = "<B>Contract of Apprenticeship:</B><BR>"
|
||||
dat += "<I>Using this contract, you may summon an apprentice to aid you on your mission.</I><BR>"
|
||||
dat += "<I>If you are unable to establish contact with your apprentice, you can feed the contract back to the spellbook to refund your points.</I><BR>"
|
||||
dat += "<B>Which school of magic is your apprentice studying?:</B><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];school=destruction'>Destruction</A><BR>"
|
||||
dat += "<I>Your apprentice is skilled in offensive magic. They know Magic Missile and Fireball.</I><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];school=bluespace'>Bluespace Manipulation</A><BR>"
|
||||
dat += "<I>Your apprentice is able to defy physics, melting through solid objects and travelling great distances in the blink of an eye. They know Teleport and Ethereal Jaunt.</I><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];school=healing'>Healing</A><BR>"
|
||||
dat += "<I>Your apprentice is training to cast spells that will aid your survival. They know Forcewall and Charge and come with a Staff of Healing.</I><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];school=robeless'>Robeless</A><BR>"
|
||||
dat += "<I>Your apprentice is training to cast spells without their robes. They know Knock and Mindswap.</I><BR>"
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
/obj/item/weapon/antag_spawner/contract/Topic(href, href_list)
|
||||
..()
|
||||
var/mob/living/carbon/human/H = usr
|
||||
|
||||
if(H.stat || H.restrained())
|
||||
return
|
||||
if(!ishuman(H))
|
||||
return 1
|
||||
|
||||
if(loc == H || (in_range(src, H) && isturf(loc)))
|
||||
H.set_machine(src)
|
||||
if(href_list["school"])
|
||||
if(used)
|
||||
to_chat(H, "You already used this contract!")
|
||||
return
|
||||
var/list/candidates = pollCandidatesForMob("Do you want to play as a wizard's [href_list["school"]] apprentice?", ROLE_WIZARD, null, ROLE_WIZARD, 150, src)
|
||||
if(candidates.len)
|
||||
if(used)
|
||||
to_chat(H, "You already used this contract!")
|
||||
return
|
||||
used = 1
|
||||
var/mob/dead/observer/theghost = pick(candidates)
|
||||
spawn_antag(theghost.client, get_turf(src), href_list["school"])
|
||||
if(H && H.mind)
|
||||
SSticker.mode.update_wiz_icons_added(H.mind)
|
||||
else
|
||||
to_chat(H, "Unable to reach your apprentice! You can either attack the spellbook with the contract to refund your points, or wait and try again later.")
|
||||
|
||||
/obj/item/weapon/antag_spawner/contract/spawn_antag(client/C, turf/T, type = "")
|
||||
new /obj/effect/particle_effect/smoke(T)
|
||||
var/mob/living/carbon/human/M = new/mob/living/carbon/human(T)
|
||||
C.prefs.copy_to(M)
|
||||
M.key = C.key
|
||||
var/wizard_name = "the wizard"
|
||||
if(usr)
|
||||
wizard_name = usr.real_name
|
||||
to_chat(M, "<B>You are [wizard_name]'s apprentice! You are bound by magic contract to follow their orders and help them in accomplishing their goals.")
|
||||
switch(type)
|
||||
if("destruction")
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile(null))
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/aimed/fireball(null))
|
||||
to_chat(M, "<B>Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned powerful, destructive spells. You are able to cast magic missile and fireball.")
|
||||
if("bluespace")
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/area_teleport/teleport(null))
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(null))
|
||||
to_chat(M, "<B>Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned reality bending mobility spells. You are able to cast teleport and ethereal jaunt.")
|
||||
if("healing")
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/charge(null))
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/forcewall(null))
|
||||
M.put_in_hands_or_del(new /obj/item/weapon/gun/magic/staff/healing(M))
|
||||
to_chat(M, "<B>Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned livesaving survival spells. You are able to cast charge and forcewall.")
|
||||
if("robeless")
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/knock(null))
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/mind_transfer(null))
|
||||
to_chat(M, "<B>Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned stealthy, robeless spells. You are able to cast knock and mindswap.")
|
||||
|
||||
equip_antag(M)
|
||||
var/wizard_name_first = pick(GLOB.wizard_first)
|
||||
var/wizard_name_second = pick(GLOB.wizard_second)
|
||||
var/randomname = "[wizard_name_first] [wizard_name_second]"
|
||||
if(usr)
|
||||
var/datum/objective/protect/new_objective = new /datum/objective/protect
|
||||
new_objective.owner = M.mind
|
||||
new_objective.target = usr.mind
|
||||
new_objective.explanation_text = "Protect [usr.real_name], the wizard."
|
||||
M.mind.objectives += new_objective
|
||||
SSticker.mode.apprentices += M.mind
|
||||
M.mind.special_role = "apprentice"
|
||||
SSticker.mode.update_wiz_icons_added(M.mind)
|
||||
M << sound('sound/effects/magic.ogg')
|
||||
var/newname = copytext(sanitize(input(M, "You are [wizard_name]'s apprentice. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
|
||||
if (!newname)
|
||||
newname = randomname
|
||||
M.mind.name = newname
|
||||
M.real_name = newname
|
||||
M.name = newname
|
||||
M.dna.update_dna_identity()
|
||||
|
||||
/obj/item/weapon/antag_spawner/contract/equip_antag(mob/target)
|
||||
target.equip_to_slot_or_del(new /obj/item/device/radio/headset(target), slot_ears)
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(target), slot_w_uniform)
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal/magic(target), slot_shoes)
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(target), slot_wear_suit)
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(target), slot_head)
|
||||
target.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(target), slot_back)
|
||||
target.equip_to_slot_or_del(new /obj/item/weapon/storage/box(target), slot_in_backpack)
|
||||
target.equip_to_slot_or_del(new /obj/item/weapon/teleportation_scroll/apprentice(target), slot_r_store)
|
||||
///////////BORGS AND OPERATIVES
|
||||
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops
|
||||
name = "syndicate operative teleporter"
|
||||
desc = "A single-use teleporter designed to quickly reinforce operatives in the field."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "locator"
|
||||
var/borg_to_spawn
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/proc/check_usability(mob/user)
|
||||
if(used)
|
||||
to_chat(user, "<span class='warning'>[src] is out of power!</span>")
|
||||
return 0
|
||||
if(!(user.mind in SSticker.mode.syndicates))
|
||||
to_chat(user, "<span class='danger'>AUTHENTICATION FAILURE. ACCESS DENIED.</span>")
|
||||
return 0
|
||||
if(user.z != ZLEVEL_CENTCOM)
|
||||
to_chat(user, "<span class='warning'>[src] is out of range! It can only be used at your base!</span>")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/attack_self(mob/user)
|
||||
if(!(check_usability(user)))
|
||||
return
|
||||
|
||||
/obj/item/weapon/antag_spawner
|
||||
throw_speed = 1
|
||||
throw_range = 5
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
var/used = 0
|
||||
|
||||
/obj/item/weapon/antag_spawner/proc/spawn_antag(client/C, turf/T, type = "")
|
||||
return
|
||||
|
||||
/obj/item/weapon/antag_spawner/proc/equip_antag(mob/target)
|
||||
return
|
||||
|
||||
|
||||
///////////WIZARD
|
||||
|
||||
/obj/item/weapon/antag_spawner/contract
|
||||
name = "contract"
|
||||
desc = "A magic contract previously signed by an apprentice. In exchange for instruction in the magical arts, they are bound to answer your call for aid."
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state ="scroll2"
|
||||
|
||||
/obj/item/weapon/antag_spawner/contract/attack_self(mob/user)
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
if(used)
|
||||
dat = "<B>You have already summoned your apprentice.</B><BR>"
|
||||
else
|
||||
dat = "<B>Contract of Apprenticeship:</B><BR>"
|
||||
dat += "<I>Using this contract, you may summon an apprentice to aid you on your mission.</I><BR>"
|
||||
dat += "<I>If you are unable to establish contact with your apprentice, you can feed the contract back to the spellbook to refund your points.</I><BR>"
|
||||
dat += "<B>Which school of magic is your apprentice studying?:</B><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];school=destruction'>Destruction</A><BR>"
|
||||
dat += "<I>Your apprentice is skilled in offensive magic. They know Magic Missile and Fireball.</I><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];school=bluespace'>Bluespace Manipulation</A><BR>"
|
||||
dat += "<I>Your apprentice is able to defy physics, melting through solid objects and travelling great distances in the blink of an eye. They know Teleport and Ethereal Jaunt.</I><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];school=healing'>Healing</A><BR>"
|
||||
dat += "<I>Your apprentice is training to cast spells that will aid your survival. They know Forcewall and Charge and come with a Staff of Healing.</I><BR>"
|
||||
dat += "<A href='byond://?src=\ref[src];school=robeless'>Robeless</A><BR>"
|
||||
dat += "<I>Your apprentice is training to cast spells without their robes. They know Knock and Mindswap.</I><BR>"
|
||||
user << browse(dat, "window=radio")
|
||||
onclose(user, "radio")
|
||||
return
|
||||
|
||||
/obj/item/weapon/antag_spawner/contract/Topic(href, href_list)
|
||||
..()
|
||||
var/mob/living/carbon/human/H = usr
|
||||
|
||||
if(H.stat || H.restrained())
|
||||
return
|
||||
if(!ishuman(H))
|
||||
return 1
|
||||
|
||||
if(loc == H || (in_range(src, H) && isturf(loc)))
|
||||
H.set_machine(src)
|
||||
if(href_list["school"])
|
||||
if(used)
|
||||
to_chat(H, "You already used this contract!")
|
||||
return
|
||||
var/list/candidates = pollCandidatesForMob("Do you want to play as a wizard's [href_list["school"]] apprentice?", ROLE_WIZARD, null, ROLE_WIZARD, 150, src)
|
||||
if(candidates.len)
|
||||
if(used)
|
||||
to_chat(H, "You already used this contract!")
|
||||
return
|
||||
used = 1
|
||||
var/mob/dead/observer/theghost = pick(candidates)
|
||||
spawn_antag(theghost.client, get_turf(src), href_list["school"])
|
||||
if(H && H.mind)
|
||||
SSticker.mode.update_wiz_icons_added(H.mind)
|
||||
else
|
||||
to_chat(H, "Unable to reach your apprentice! You can either attack the spellbook with the contract to refund your points, or wait and try again later.")
|
||||
|
||||
/obj/item/weapon/antag_spawner/contract/spawn_antag(client/C, turf/T, type = "")
|
||||
new /obj/effect/particle_effect/smoke(T)
|
||||
var/mob/living/carbon/human/M = new/mob/living/carbon/human(T)
|
||||
C.prefs.copy_to(M)
|
||||
M.key = C.key
|
||||
var/wizard_name = "the wizard"
|
||||
if(usr)
|
||||
wizard_name = usr.real_name
|
||||
to_chat(M, "<B>You are [wizard_name]'s apprentice! You are bound by magic contract to follow their orders and help them in accomplishing their goals.")
|
||||
switch(type)
|
||||
if("destruction")
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/projectile/magic_missile(null))
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/aimed/fireball(null))
|
||||
to_chat(M, "<B>Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned powerful, destructive spells. You are able to cast magic missile and fireball.")
|
||||
if("bluespace")
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/area_teleport/teleport(null))
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/ethereal_jaunt(null))
|
||||
to_chat(M, "<B>Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned reality bending mobility spells. You are able to cast teleport and ethereal jaunt.")
|
||||
if("healing")
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/charge(null))
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/forcewall(null))
|
||||
M.put_in_hands_or_del(new /obj/item/weapon/gun/magic/staff/healing(M))
|
||||
to_chat(M, "<B>Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned livesaving survival spells. You are able to cast charge and forcewall.")
|
||||
if("robeless")
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/knock(null))
|
||||
M.mind.AddSpell(new /obj/effect/proc_holder/spell/targeted/mind_transfer(null))
|
||||
to_chat(M, "<B>Your service has not gone unrewarded, however. Studying under [wizard_name], you have learned stealthy, robeless spells. You are able to cast knock and mindswap.")
|
||||
|
||||
equip_antag(M)
|
||||
var/wizard_name_first = pick(GLOB.wizard_first)
|
||||
var/wizard_name_second = pick(GLOB.wizard_second)
|
||||
var/randomname = "[wizard_name_first] [wizard_name_second]"
|
||||
if(usr)
|
||||
var/datum/objective/protect/new_objective = new /datum/objective/protect
|
||||
new_objective.owner = M.mind
|
||||
new_objective.target = usr.mind
|
||||
new_objective.explanation_text = "Protect [usr.real_name], the wizard."
|
||||
M.mind.objectives += new_objective
|
||||
SSticker.mode.apprentices += M.mind
|
||||
M.mind.special_role = "apprentice"
|
||||
SSticker.mode.update_wiz_icons_added(M.mind)
|
||||
M << sound('sound/effects/magic.ogg')
|
||||
var/newname = copytext(sanitize(input(M, "You are [wizard_name]'s apprentice. Would you like to change your name to something else?", "Name change", randomname) as null|text),1,MAX_NAME_LEN)
|
||||
if (!newname)
|
||||
newname = randomname
|
||||
M.mind.name = newname
|
||||
M.real_name = newname
|
||||
M.name = newname
|
||||
M.age = rand(AGE_MIN, WIZARD_AGE_MIN - 1)
|
||||
M.dna.update_dna_identity()
|
||||
|
||||
/obj/item/weapon/antag_spawner/contract/equip_antag(mob/target)
|
||||
target.equip_to_slot_or_del(new /obj/item/device/radio/headset(target), slot_ears)
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(target), slot_w_uniform)
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/shoes/sandal/magic(target), slot_shoes)
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/suit/wizrobe(target), slot_wear_suit)
|
||||
target.equip_to_slot_or_del(new /obj/item/clothing/head/wizard(target), slot_head)
|
||||
target.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(target), slot_back)
|
||||
target.equip_to_slot_or_del(new /obj/item/weapon/storage/box(target), slot_in_backpack)
|
||||
target.equip_to_slot_or_del(new /obj/item/weapon/teleportation_scroll/apprentice(target), slot_r_store)
|
||||
///////////BORGS AND OPERATIVES
|
||||
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops
|
||||
name = "syndicate operative teleporter"
|
||||
desc = "A single-use teleporter designed to quickly reinforce operatives in the field."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "locator"
|
||||
var/borg_to_spawn
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/proc/check_usability(mob/user)
|
||||
if(used)
|
||||
to_chat(user, "<span class='warning'>[src] is out of power!</span>")
|
||||
return 0
|
||||
if(!(user.mind in SSticker.mode.syndicates))
|
||||
to_chat(user, "<span class='danger'>AUTHENTICATION FAILURE. ACCESS DENIED.</span>")
|
||||
return 0
|
||||
if(user.z != ZLEVEL_CENTCOM)
|
||||
to_chat(user, "<span class='warning'>[src] is out of range! It can only be used at your base!</span>")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/attack_self(mob/user)
|
||||
if(!(check_usability(user)))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You activate [src] and wait for confirmation.</span>")
|
||||
var/list/nuke_candidates = pollCandidatesForMob("Do you want to play as a syndicate [borg_to_spawn ? "[lowertext(borg_to_spawn)] cyborg":"operative"]?", ROLE_OPERATIVE, null, ROLE_OPERATIVE, 150, POLL_IGNORE_SYNDICATE, src)
|
||||
if(nuke_candidates.len)
|
||||
if(!(check_usability(user)))
|
||||
return
|
||||
used = 1
|
||||
var/mob/dead/observer/theghost = pick(nuke_candidates)
|
||||
spawn_antag(theghost.client, get_turf(src), "syndieborg")
|
||||
do_sparks(4, TRUE, src)
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Unable to connect to Syndicate command. Please wait and try again later or use the teleporter on your uplink to get your points refunded.</span>")
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/spawn_antag(client/C, turf/T)
|
||||
var/mob/living/carbon/human/M = new/mob/living/carbon/human(T)
|
||||
C.prefs.copy_to(M)
|
||||
M.key = C.key
|
||||
var/code = "BOMB-NOT-FOUND"
|
||||
var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in GLOB.nuke_list
|
||||
if(nuke)
|
||||
code = nuke.r_code
|
||||
M.mind.make_Nuke(null, code, 0, FALSE)
|
||||
var/newname = M.dna.species.random_name(M.gender,0,SSticker.mode.nukeops_lastname)
|
||||
M.mind.name = newname
|
||||
M.real_name = newname
|
||||
M.name = newname
|
||||
|
||||
//////SYNDICATE BORG
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/borg_tele
|
||||
name = "syndicate cyborg teleporter"
|
||||
desc = "A single-use teleporter designed to quickly reinforce operatives in the field.."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "locator"
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/borg_tele/assault
|
||||
name = "syndicate assault cyborg teleporter"
|
||||
borg_to_spawn = "Assault"
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/borg_tele/medical
|
||||
name = "syndicate medical teleporter"
|
||||
borg_to_spawn = "Medical"
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/borg_tele/spawn_antag(client/C, turf/T)
|
||||
var/mob/living/silicon/robot/R
|
||||
switch(borg_to_spawn)
|
||||
if("Medical")
|
||||
R = new /mob/living/silicon/robot/syndicate/medical(T)
|
||||
else
|
||||
R = new /mob/living/silicon/robot/syndicate(T) //Assault borg by default
|
||||
|
||||
var/brainfirstname = pick(GLOB.first_names_male)
|
||||
if(prob(50))
|
||||
brainfirstname = pick(GLOB.first_names_female)
|
||||
var/brainopslastname = pick(GLOB.last_names)
|
||||
if(SSticker.mode.nukeops_lastname) //the brain inside the syndiborg has the same last name as the other ops.
|
||||
brainopslastname = SSticker.mode.nukeops_lastname
|
||||
var/brainopsname = "[brainfirstname] [brainopslastname]"
|
||||
|
||||
R.mmi.name = "Man-Machine Interface: [brainopsname]"
|
||||
R.mmi.brain.name = "[brainopsname]'s brain"
|
||||
R.mmi.brainmob.real_name = brainopsname
|
||||
R.mmi.brainmob.name = brainopsname
|
||||
|
||||
R.key = C.key
|
||||
R.mind.make_Nuke(null, nuke_code = null,leader=0, telecrystals = TRUE)
|
||||
|
||||
///////////SLAUGHTER DEMON
|
||||
|
||||
/obj/item/weapon/antag_spawner/slaughter_demon //Warning edgiest item in the game
|
||||
name = "vial of blood"
|
||||
desc = "A magically infused bottle of blood, distilled from countless murder victims. Used in unholy rituals to attract horrifying creatures."
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "vial"
|
||||
|
||||
var/shatter_msg = "<span class='notice'>You shatter the bottle, no turning back now!</span>"
|
||||
var/veil_msg = "<span class='warning'>You sense a dark presence lurking just beyond the veil...</span>"
|
||||
var/objective_verb = "Kill"
|
||||
var/mob/living/demon_type = /mob/living/simple_animal/slaughter
|
||||
|
||||
|
||||
/obj/item/weapon/antag_spawner/slaughter_demon/attack_self(mob/user)
|
||||
if(user.z != 1)
|
||||
to_chat(user, "<span class='notice'>You should probably wait until you reach the station.</span>")
|
||||
return
|
||||
if(used)
|
||||
return
|
||||
var/list/demon_candidates = pollCandidatesForMob("Do you want to play as a [initial(demon_type.name)]?", null, null, ROLE_ALIEN, 50, src)
|
||||
if(demon_candidates.len)
|
||||
if(used)
|
||||
return
|
||||
used = 1
|
||||
var/mob/dead/observer/theghost = pick(demon_candidates)
|
||||
spawn_antag(theghost.client, get_turf(src), initial(demon_type.name))
|
||||
to_chat(user, shatter_msg)
|
||||
to_chat(user, veil_msg)
|
||||
playsound(user.loc, 'sound/effects/Glassbr1.ogg', 100, 1)
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You can't seem to work up the nerve to shatter the bottle. Perhaps you should try again later.</span>")
|
||||
|
||||
|
||||
/obj/item/weapon/antag_spawner/slaughter_demon/spawn_antag(client/C, turf/T, type = "")
|
||||
|
||||
var /obj/effect/dummy/slaughter/holder = new /obj/effect/dummy/slaughter(T)
|
||||
var/mob/living/simple_animal/slaughter/S = new demon_type(holder)
|
||||
S.holder = holder
|
||||
S.key = C.key
|
||||
S.mind.assigned_role = S.name
|
||||
S.mind.special_role = S.name
|
||||
SSticker.mode.traitors += S.mind
|
||||
var/datum/objective/assassinate/new_objective
|
||||
if(usr)
|
||||
new_objective = new /datum/objective/assassinate
|
||||
new_objective.owner = S.mind
|
||||
new_objective.target = usr.mind
|
||||
new_objective.explanation_text = "[objective_verb] [usr.real_name], the one who summoned you."
|
||||
S.mind.objectives += new_objective
|
||||
var/datum/objective/new_objective2 = new /datum/objective
|
||||
new_objective2.owner = S.mind
|
||||
new_objective2.explanation_text = "[objective_verb] everyone[usr ? " else while you're at it":""]."
|
||||
S.mind.objectives += new_objective2
|
||||
to_chat(S, S.playstyle_string)
|
||||
to_chat(S, "<B>You are currently not currently in the same plane of existence as the station. \
|
||||
Ctrl+Click a blood pool to manifest.</B>")
|
||||
if(new_objective)
|
||||
to_chat(S, "<B>Objective #[1]</B>: [new_objective.explanation_text]")
|
||||
to_chat(S, "<B>Objective #[new_objective ? "[2]":"[1]"]</B>: [new_objective2.explanation_text]")
|
||||
|
||||
/obj/item/weapon/antag_spawner/slaughter_demon/laughter
|
||||
name = "vial of tickles"
|
||||
desc = "A magically infused bottle of clown love, distilled from countless hugging attacks. Used in funny rituals to attract adorable creatures."
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "vial"
|
||||
color = "#FF69B4" // HOT PINK
|
||||
|
||||
veil_msg = "<span class='warning'>You sense an adorable presence lurking just beyond the veil...</span>"
|
||||
objective_verb = "Hug and Tickle"
|
||||
demon_type = /mob/living/simple_animal/slaughter/laughter
|
||||
if(nuke_candidates.len)
|
||||
if(!(check_usability(user)))
|
||||
return
|
||||
used = 1
|
||||
var/mob/dead/observer/theghost = pick(nuke_candidates)
|
||||
spawn_antag(theghost.client, get_turf(src), "syndieborg")
|
||||
do_sparks(4, TRUE, src)
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Unable to connect to Syndicate command. Please wait and try again later or use the teleporter on your uplink to get your points refunded.</span>")
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/spawn_antag(client/C, turf/T)
|
||||
var/mob/living/carbon/human/M = new/mob/living/carbon/human(T)
|
||||
C.prefs.copy_to(M)
|
||||
M.key = C.key
|
||||
var/code = "BOMB-NOT-FOUND"
|
||||
var/obj/machinery/nuclearbomb/nuke = locate("syndienuke") in GLOB.nuke_list
|
||||
if(nuke)
|
||||
code = nuke.r_code
|
||||
M.mind.make_Nuke(null, code, 0, FALSE)
|
||||
var/newname = M.dna.species.random_name(M.gender,0,SSticker.mode.nukeops_lastname)
|
||||
M.mind.name = newname
|
||||
M.real_name = newname
|
||||
M.name = newname
|
||||
|
||||
//////SYNDICATE BORG
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/borg_tele
|
||||
name = "syndicate cyborg teleporter"
|
||||
desc = "A single-use teleporter designed to quickly reinforce operatives in the field.."
|
||||
icon = 'icons/obj/device.dmi'
|
||||
icon_state = "locator"
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/borg_tele/assault
|
||||
name = "syndicate assault cyborg teleporter"
|
||||
borg_to_spawn = "Assault"
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/borg_tele/medical
|
||||
name = "syndicate medical teleporter"
|
||||
borg_to_spawn = "Medical"
|
||||
|
||||
/obj/item/weapon/antag_spawner/nuke_ops/borg_tele/spawn_antag(client/C, turf/T)
|
||||
var/mob/living/silicon/robot/R
|
||||
switch(borg_to_spawn)
|
||||
if("Medical")
|
||||
R = new /mob/living/silicon/robot/syndicate/medical(T)
|
||||
else
|
||||
R = new /mob/living/silicon/robot/syndicate(T) //Assault borg by default
|
||||
|
||||
var/brainfirstname = pick(GLOB.first_names_male)
|
||||
if(prob(50))
|
||||
brainfirstname = pick(GLOB.first_names_female)
|
||||
var/brainopslastname = pick(GLOB.last_names)
|
||||
if(SSticker.mode.nukeops_lastname) //the brain inside the syndiborg has the same last name as the other ops.
|
||||
brainopslastname = SSticker.mode.nukeops_lastname
|
||||
var/brainopsname = "[brainfirstname] [brainopslastname]"
|
||||
|
||||
R.mmi.name = "Man-Machine Interface: [brainopsname]"
|
||||
R.mmi.brain.name = "[brainopsname]'s brain"
|
||||
R.mmi.brainmob.real_name = brainopsname
|
||||
R.mmi.brainmob.name = brainopsname
|
||||
|
||||
R.key = C.key
|
||||
R.mind.make_Nuke(null, nuke_code = null,leader=0, telecrystals = TRUE)
|
||||
|
||||
///////////SLAUGHTER DEMON
|
||||
|
||||
/obj/item/weapon/antag_spawner/slaughter_demon //Warning edgiest item in the game
|
||||
name = "vial of blood"
|
||||
desc = "A magically infused bottle of blood, distilled from countless murder victims. Used in unholy rituals to attract horrifying creatures."
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "vial"
|
||||
|
||||
var/shatter_msg = "<span class='notice'>You shatter the bottle, no turning back now!</span>"
|
||||
var/veil_msg = "<span class='warning'>You sense a dark presence lurking just beyond the veil...</span>"
|
||||
var/objective_verb = "Kill"
|
||||
var/mob/living/demon_type = /mob/living/simple_animal/slaughter
|
||||
|
||||
|
||||
/obj/item/weapon/antag_spawner/slaughter_demon/attack_self(mob/user)
|
||||
if(user.z != 1)
|
||||
to_chat(user, "<span class='notice'>You should probably wait until you reach the station.</span>")
|
||||
return
|
||||
if(used)
|
||||
return
|
||||
var/list/demon_candidates = pollCandidatesForMob("Do you want to play as a [initial(demon_type.name)]?", null, null, ROLE_ALIEN, 50, src)
|
||||
if(demon_candidates.len)
|
||||
if(used)
|
||||
return
|
||||
used = 1
|
||||
var/mob/dead/observer/theghost = pick(demon_candidates)
|
||||
spawn_antag(theghost.client, get_turf(src), initial(demon_type.name))
|
||||
to_chat(user, shatter_msg)
|
||||
to_chat(user, veil_msg)
|
||||
playsound(user.loc, 'sound/effects/Glassbr1.ogg', 100, 1)
|
||||
qdel(src)
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You can't seem to work up the nerve to shatter the bottle. Perhaps you should try again later.</span>")
|
||||
|
||||
|
||||
/obj/item/weapon/antag_spawner/slaughter_demon/spawn_antag(client/C, turf/T, type = "")
|
||||
|
||||
var /obj/effect/dummy/slaughter/holder = new /obj/effect/dummy/slaughter(T)
|
||||
var/mob/living/simple_animal/slaughter/S = new demon_type(holder)
|
||||
S.holder = holder
|
||||
S.key = C.key
|
||||
S.mind.assigned_role = S.name
|
||||
S.mind.special_role = S.name
|
||||
SSticker.mode.traitors += S.mind
|
||||
var/datum/objective/assassinate/new_objective
|
||||
if(usr)
|
||||
new_objective = new /datum/objective/assassinate
|
||||
new_objective.owner = S.mind
|
||||
new_objective.target = usr.mind
|
||||
new_objective.explanation_text = "[objective_verb] [usr.real_name], the one who summoned you."
|
||||
S.mind.objectives += new_objective
|
||||
var/datum/objective/new_objective2 = new /datum/objective
|
||||
new_objective2.owner = S.mind
|
||||
new_objective2.explanation_text = "[objective_verb] everyone[usr ? " else while you're at it":""]."
|
||||
S.mind.objectives += new_objective2
|
||||
to_chat(S, S.playstyle_string)
|
||||
to_chat(S, "<B>You are currently not currently in the same plane of existence as the station. \
|
||||
Ctrl+Click a blood pool to manifest.</B>")
|
||||
if(new_objective)
|
||||
to_chat(S, "<B>Objective #[1]</B>: [new_objective.explanation_text]")
|
||||
to_chat(S, "<B>Objective #[new_objective ? "[2]":"[1]"]</B>: [new_objective2.explanation_text]")
|
||||
|
||||
/obj/item/weapon/antag_spawner/slaughter_demon/laughter
|
||||
name = "vial of tickles"
|
||||
desc = "A magically infused bottle of clown love, distilled from countless hugging attacks. Used in funny rituals to attract adorable creatures."
|
||||
icon = 'icons/obj/wizard.dmi'
|
||||
icon_state = "vial"
|
||||
color = "#FF69B4" // HOT PINK
|
||||
|
||||
veil_msg = "<span class='warning'>You sense an adorable presence lurking just beyond the veil...</span>"
|
||||
objective_verb = "Hug and Tickle"
|
||||
demon_type = /mob/living/simple_animal/slaughter/laughter
|
||||
|
||||
@@ -200,6 +200,7 @@ GLOBAL_LIST_INIT(slot2type, list("head" = /obj/item/clothing/head/changeling, "w
|
||||
to_chat(changeling.current, "<span class='boldannounce'>You are [changeling.changeling.changelingID], a changeling! You have absorbed and taken the form of a human.</span>")
|
||||
to_chat(changeling.current, "<span class='boldannounce'>Use say \":g message\" to communicate with your fellow changelings.</span>")
|
||||
to_chat(changeling.current, "<b>You must complete the following tasks:</b>")
|
||||
changeling.current.playsound_local('sound/ambience/antag/ling_aler.ogg',100,0)
|
||||
|
||||
if (changeling.current.mind)
|
||||
var/mob/living/carbon/human/H = changeling.current
|
||||
|
||||
@@ -75,7 +75,7 @@ Credit where due:
|
||||
/proc/remove_servant_of_ratvar(mob/living/L, silent = FALSE)
|
||||
if(!L || !L.mind)
|
||||
return
|
||||
var/datum/antagonist/clockcult/clock_datum = L.mind.has_antag_datum(/datum/antagonist/clockcult)
|
||||
var/datum/antagonist/clockcult/clock_datum = L.mind.has_antag_datum(ANTAG_DATUM_CLOCKCULT)
|
||||
if(!clock_datum)
|
||||
return FALSE
|
||||
clock_datum.silent = silent
|
||||
@@ -146,6 +146,7 @@ Credit where due:
|
||||
Rusting eternally in the Celestial Derelict, Ratvar has formed a covenant of mortals, with you as one of its members. As one of the Justiciar's servants, you are to work to the best of your \
|
||||
ability to assist in completion of His agenda. You may not know the specifics of how to do so, but luckily you have a vessel to help you learn.</b>"
|
||||
to_chat(M, greeting_text)
|
||||
M.playsound_local('sound/ambience/antag/ClockCultAlr.ogg',100,0)
|
||||
return 1
|
||||
|
||||
/datum/game_mode/proc/equip_servant(mob/living/L) //Grants a clockwork slab to the mob, with one of each component
|
||||
|
||||
@@ -5,60 +5,60 @@
|
||||
//otherwise, return literally any non-list thing but preferably FALSE
|
||||
//returning TRUE won't produce the "cannot be proselytized" message and will still prevent proselytizing
|
||||
|
||||
/atom/proc/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/atom/proc/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
//Turf conversion
|
||||
/turf/closed/wall/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //four sheets of metal
|
||||
/turf/closed/wall/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent) //four sheets of metal
|
||||
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_TOTAL - (POWER_METAL * 4), "spawn_dir" = SOUTH)
|
||||
|
||||
/turf/closed/wall/mineral/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //two sheets of metal
|
||||
/turf/closed/wall/mineral/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent) //two sheets of metal
|
||||
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_TOTAL - (POWER_METAL * 2), "spawn_dir" = SOUTH)
|
||||
|
||||
/turf/closed/wall/mineral/iron/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //two sheets of metal, five rods
|
||||
/turf/closed/wall/mineral/iron/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent) //two sheets of metal, five rods
|
||||
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_TOTAL - (POWER_METAL * 2) - (POWER_ROD * 5), "spawn_dir" = SOUTH)
|
||||
|
||||
/turf/closed/wall/mineral/cult/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //no metal
|
||||
/turf/closed/wall/mineral/cult/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent) //no metal
|
||||
return list("operation_time" = 80, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_TOTAL, "spawn_dir" = SOUTH)
|
||||
|
||||
/turf/closed/wall/shuttle/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //two sheets of metal
|
||||
/turf/closed/wall/shuttle/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent) //two sheets of metal
|
||||
return list("operation_time" = 50, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_TOTAL - (POWER_METAL * 2), "spawn_dir" = SOUTH)
|
||||
|
||||
/turf/closed/wall/r_wall/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/turf/closed/wall/r_wall/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
/turf/closed/wall/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/turf/closed/wall/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return list("operation_time" = 50, "new_obj_type" = /turf/open/floor/clockwork, "power_cost" = -POWER_WALL_MINUS_FLOOR, "spawn_dir" = SOUTH)
|
||||
|
||||
/turf/open/floor/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/turf/open/floor/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
if(floor_tile == /obj/item/stack/tile/plasteel)
|
||||
new floor_tile(src)
|
||||
make_plating()
|
||||
playsound(src, 'sound/items/Crowbar.ogg', 10, 1) //clink
|
||||
return list("operation_time" = 30, "new_obj_type" = /turf/open/floor/clockwork, "power_cost" = POWER_FLOOR, "spawn_dir" = SOUTH)
|
||||
|
||||
/turf/open/floor/plating/asteroid/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/turf/open/floor/plating/asteroid/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
/turf/open/floor/plating/ashplanet/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/turf/open/floor/plating/ashplanet/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
/turf/open/floor/plating/lava/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/turf/open/floor/plating/lava/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
/turf/open/floor/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/turf/open/floor/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
if(locate(/obj/structure/table) in src)
|
||||
return FALSE
|
||||
if(is_blocked_turf(src, TRUE))
|
||||
to_chat(user, "<span class='warning'>Something is in the way, preventing you from proselytizing [src] into a clockwork wall.</span>")
|
||||
return TRUE
|
||||
var/operation_time = 100
|
||||
if(proselytizer.speed_multiplier > 0)
|
||||
if(!GLOB.ratvar_awakens && proselytizer.speed_multiplier > 0) //if ratvar isn't awake, this always takes 10 seconds
|
||||
operation_time /= proselytizer.speed_multiplier
|
||||
return list("operation_time" = operation_time, "new_obj_type" = /turf/closed/wall/clockwork, "power_cost" = POWER_WALL_MINUS_FLOOR, "spawn_dir" = SOUTH)
|
||||
|
||||
//False wall conversion
|
||||
/obj/structure/falsewall/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/falsewall/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
var/cost = POWER_WALL_MINUS_FLOOR
|
||||
if(ispath(mineral, /obj/item/stack/sheet/metal))
|
||||
cost -= (POWER_METAL * (2 + mineral_amount)) //four sheets of metal, plus an assumption that the girder is also two
|
||||
@@ -66,17 +66,17 @@
|
||||
cost -= (POWER_METAL * 2) //anything that doesn't use metal just has the girder
|
||||
return list("operation_time" = 50, "new_obj_type" = /obj/structure/falsewall/brass, "power_cost" = cost, "spawn_dir" = SOUTH)
|
||||
|
||||
/obj/structure/falsewall/iron/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer) //two sheets of metal, two rods; special assumption
|
||||
/obj/structure/falsewall/iron/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent) //two sheets of metal, two rods; special assumption
|
||||
return list("operation_time" = 50, "new_obj_type" = /obj/structure/falsewall/brass, "power_cost" = POWER_WALL_MINUS_FLOOR - (POWER_METAL * 2) - (POWER_ROD * 2), "spawn_dir" = SOUTH)
|
||||
|
||||
/obj/structure/falsewall/reinforced/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/falsewall/reinforced/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
/obj/structure/falsewall/brass/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/falsewall/brass/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
//Metal conversion
|
||||
/obj/item/stack/tile/plasteel/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/item/stack/tile/plasteel/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
if(source)
|
||||
return FALSE
|
||||
var/amount_temp = get_amount()
|
||||
@@ -104,7 +104,7 @@
|
||||
to_chat(user, "<span class='warning'>You need at least <b>20</b> floor tiles to convert into brass.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/stack/rods/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/item/stack/rods/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
if(source)
|
||||
return FALSE
|
||||
if(proselytizer.metal_to_power)
|
||||
@@ -122,7 +122,7 @@
|
||||
to_chat(user, "<span class='warning'>You need at least <b>10</b> rods to convert into brass.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/stack/sheet/metal/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/item/stack/sheet/metal/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
if(source)
|
||||
return FALSE
|
||||
if(proselytizer.metal_to_power)
|
||||
@@ -140,7 +140,7 @@
|
||||
to_chat(user, "<span class='warning'>You need at least <b>5</b> sheets of metal to convert into brass.</span>")
|
||||
return TRUE
|
||||
|
||||
/obj/item/stack/sheet/plasteel/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/item/stack/sheet/plasteel/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
if(source)
|
||||
return FALSE
|
||||
if(proselytizer.metal_to_power)
|
||||
@@ -159,23 +159,23 @@
|
||||
return TRUE
|
||||
|
||||
//Brass directly to power
|
||||
/obj/item/stack/tile/brass/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/item/stack/tile/brass/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
if(source)
|
||||
return FALSE
|
||||
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(amount*POWER_FLOOR), "spawn_dir" = SOUTH)
|
||||
|
||||
//Airlock conversion
|
||||
/obj/machinery/door/airlock/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/machinery/door/airlock/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
var/doortype = /obj/machinery/door/airlock/clockwork
|
||||
if(glass)
|
||||
doortype = /obj/machinery/door/airlock/clockwork/brass
|
||||
return list("operation_time" = 60, "new_obj_type" = doortype, "power_cost" = POWER_WALL_TOTAL, "spawn_dir" = dir)
|
||||
|
||||
/obj/machinery/door/airlock/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/machinery/door/airlock/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
//Table conversion
|
||||
/obj/structure/table/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/table/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
var/prosel_cost = POWER_STANDARD
|
||||
if(framestack == /obj/item/stack/rods)
|
||||
prosel_cost -= POWER_ROD*framestackamount
|
||||
@@ -187,10 +187,10 @@
|
||||
prosel_cost -= POWER_PLASTEEL*buildstackamount
|
||||
return list("operation_time" = 20, "new_obj_type" = /obj/structure/table/reinforced/brass, "power_cost" = prosel_cost, "spawn_dir" = SOUTH)
|
||||
|
||||
/obj/structure/table/reinforced/brass/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/table/reinforced/brass/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
/obj/structure/table_frame/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/table_frame/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
var/prosel_cost = POWER_FLOOR
|
||||
if(framestack == /obj/item/stack/rods)
|
||||
prosel_cost -= POWER_ROD*framestackamount
|
||||
@@ -198,11 +198,11 @@
|
||||
prosel_cost -= POWER_FLOOR*framestackamount
|
||||
return list("operation_time" = 10, "new_obj_type" = /obj/structure/table_frame/brass, "power_cost" = prosel_cost, "spawn_dir" = SOUTH)
|
||||
|
||||
/obj/structure/table_frame/brass/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/table_frame/brass/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
//Window conversion
|
||||
/obj/structure/window/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/window/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
var/windowtype = /obj/structure/window/reinforced/clockwork
|
||||
var/new_dir = TRUE
|
||||
var/prosel_time = 15
|
||||
@@ -220,18 +220,18 @@
|
||||
INVOKE_ASYNC(proselytizer, /obj/item/clockwork/clockwork_proselytizer.proc/proselytize, G, user)
|
||||
return list("operation_time" = prosel_time, "new_obj_type" = windowtype, "power_cost" = prosel_cost, "spawn_dir" = dir, "dir_in_new" = new_dir)
|
||||
|
||||
/obj/structure/window/reinforced/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/window/reinforced/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
//Windoor conversion
|
||||
/obj/machinery/door/window/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/machinery/door/window/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return list("operation_time" = 30, "new_obj_type" = /obj/machinery/door/window/clockwork, "power_cost" = POWER_STANDARD, "spawn_dir" = dir, "dir_in_new" = TRUE)
|
||||
|
||||
/obj/machinery/door/window/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/machinery/door/window/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
//Grille conversion
|
||||
/obj/structure/grille/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/grille/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
var/grilletype = /obj/structure/grille/ratvar
|
||||
var/prosel_time = 15
|
||||
if(broken)
|
||||
@@ -239,32 +239,32 @@
|
||||
prosel_time = 5
|
||||
return list("operation_time" = prosel_time, "new_obj_type" = grilletype, "power_cost" = 0, "spawn_dir" = dir)
|
||||
|
||||
/obj/structure/grille/ratvar/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/grille/ratvar/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
//Lattice conversion
|
||||
/obj/structure/lattice/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/lattice/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return list("operation_time" = 0, "new_obj_type" = /obj/structure/lattice/clockwork, "power_cost" = 0, "spawn_dir" = SOUTH, "no_target_deletion" = TRUE)
|
||||
|
||||
/obj/structure/lattice/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/lattice/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
ratvar_act() //just in case we're the wrong type for some reason??
|
||||
return FALSE
|
||||
|
||||
/obj/structure/lattice/catwalk/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/lattice/catwalk/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return list("operation_time" = 0, "new_obj_type" = /obj/structure/lattice/catwalk/clockwork, "power_cost" = 0, "spawn_dir" = SOUTH, "no_target_deletion" = TRUE)
|
||||
|
||||
/obj/structure/lattice/catwalk/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/lattice/catwalk/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
return FALSE
|
||||
|
||||
//Girder conversion
|
||||
/obj/structure/girder/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/girder/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
var/prosel_cost = POWER_GEAR - (POWER_METAL * 2)
|
||||
if(state == GIRDER_REINF_STRUTS || state == GIRDER_REINF)
|
||||
prosel_cost -= POWER_PLASTEEL
|
||||
return list("operation_time" = 20, "new_obj_type" = /obj/structure/destructible/clockwork/wall_gear, "power_cost" = prosel_cost, "spawn_dir" = SOUTH)
|
||||
|
||||
//Hitting a clockwork structure will try to repair it.
|
||||
/obj/structure/destructible/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/structure/destructible/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
. = TRUE
|
||||
var/list/repair_values = list()
|
||||
if(!proselytizer.proselytizer_repair_checks(repair_values, src, user))
|
||||
@@ -287,7 +287,7 @@
|
||||
"<span class='alloy'>You finish repairing [src]. It is now at <b>[obj_integrity]/[max_integrity]</b> integrity.</span>")
|
||||
|
||||
//Hitting a sigil of transmission will try to charge from it.
|
||||
/obj/effect/clockwork/sigil/transmission/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/obj/effect/clockwork/sigil/transmission/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
. = TRUE
|
||||
var/list/charge_values = list()
|
||||
if(!proselytizer.sigil_charge_checks(charge_values, src, user))
|
||||
@@ -337,7 +337,7 @@
|
||||
adjustHealth(-amount)
|
||||
|
||||
//Hitting a ratvar'd silicon will also try to repair it.
|
||||
/mob/living/silicon/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/mob/living/silicon/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
. = TRUE
|
||||
if(health == maxHealth) //if we're at maximum health, prosel the turf under us
|
||||
return FALSE
|
||||
@@ -346,7 +346,7 @@
|
||||
"<span class='alloy'>You finish repairin[src == user ? "g yourself. You are":"g [src]. [p_they(TRUE)] [p_are()]"] now at <b>[abs(HEALTH_THRESHOLD_DEAD - health)]/[abs(HEALTH_THRESHOLD_DEAD - maxHealth)]</b> health.</span>")
|
||||
|
||||
//Same with clockwork mobs.
|
||||
/mob/living/simple_animal/hostile/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/mob/living/simple_animal/hostile/clockwork/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
. = TRUE
|
||||
if(health == maxHealth) //if we're at maximum health, prosel the turf under us
|
||||
return FALSE
|
||||
@@ -355,7 +355,7 @@
|
||||
"<span class='alloy'>You finish repairin[src == user ? "g yourself. You are":"g [src]. [p_they(TRUE)] [p_are()]"] now at <b>[health]/[maxHealth]</b> health.</span>")
|
||||
|
||||
//Cogscarabs get special interaction because they're drones and have innate self-heals/revives.
|
||||
/mob/living/simple_animal/drone/cogscarab/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
/mob/living/simple_animal/drone/cogscarab/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent)
|
||||
. = TRUE
|
||||
if(stat == DEAD)
|
||||
try_reactivate(user) //if we're at maximum health, prosel the turf under us
|
||||
@@ -374,17 +374,36 @@
|
||||
proselytizer.repairing = null
|
||||
|
||||
//Convert shards and gear bits directly to power
|
||||
/obj/item/clockwork/alloy_shards/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -POWER_STANDARD, "spawn_dir" = SOUTH)
|
||||
/obj/item/clockwork/alloy_shards/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent, power_amount)
|
||||
if(!power_amount)
|
||||
power_amount = -POWER_STANDARD
|
||||
if(proselytizer.can_use_power(power_amount))
|
||||
var/obj/effect/overlay/temp/ratvar/beam/itemconsume/B = new /obj/effect/overlay/temp/ratvar/beam/itemconsume(get_turf(src))
|
||||
B.pixel_x = pixel_x
|
||||
B.pixel_y = pixel_y
|
||||
if(!silent) //looper no looping
|
||||
for(var/obj/item/clockwork/alloy_shards/S in get_turf(src)) //convert all other shards in the turf if we can
|
||||
if(S == src)
|
||||
continue //we want the shards to be proselytized after the main shard, thus this delay
|
||||
addtimer(CALLBACK(proselytizer, /obj/item/clockwork/clockwork_proselytizer.proc/proselytize, S, user, TRUE), 0)
|
||||
return list("operation_time" = 0, "new_obj_type" = null, "power_cost" = power_amount, "spawn_dir" = SOUTH)
|
||||
|
||||
/obj/item/clockwork/alloy_shards/medium/gear_bit/large/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(CLOCKCULT_POWER_UNIT*0.08), "spawn_dir" = SOUTH)
|
||||
/obj/item/clockwork/alloy_shards/medium/gear_bit/large/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent, power_amount)
|
||||
if(!power_amount)
|
||||
power_amount = -(CLOCKCULT_POWER_UNIT*0.08)
|
||||
return ..()
|
||||
|
||||
/obj/item/clockwork/alloy_shards/large/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(CLOCKCULT_POWER_UNIT*0.06), "spawn_dir" = SOUTH)
|
||||
/obj/item/clockwork/alloy_shards/large/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent, power_amount)
|
||||
if(!power_amount)
|
||||
power_amount = -(CLOCKCULT_POWER_UNIT*0.06)
|
||||
return ..()
|
||||
|
||||
/obj/item/clockwork/alloy_shards/medium/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(CLOCKCULT_POWER_UNIT*0.04), "spawn_dir" = SOUTH)
|
||||
/obj/item/clockwork/alloy_shards/medium/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent, power_amount)
|
||||
if(!power_amount)
|
||||
power_amount = -(CLOCKCULT_POWER_UNIT*0.04)
|
||||
return ..()
|
||||
|
||||
/obj/item/clockwork/alloy_shards/small/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer)
|
||||
return list("operation_time" = 0, "new_obj_type" = /obj/effect/overlay/temp/ratvar/beam/itemconsume, "power_cost" = -(CLOCKCULT_POWER_UNIT*0.02), "spawn_dir" = SOUTH)
|
||||
/obj/item/clockwork/alloy_shards/small/proselytize_vals(mob/living/user, obj/item/clockwork/clockwork_proselytizer/proselytizer, silent, power_amount)
|
||||
if(!power_amount)
|
||||
power_amount = -(CLOCKCULT_POWER_UNIT*0.02)
|
||||
return ..()
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
ranged_mousepointer = 'icons/effects/geis_target.dmi'
|
||||
|
||||
/obj/effect/proc_holder/slab/geis/InterceptClickOn(mob/living/caller, params, atom/target)
|
||||
if(target == slab || ..())
|
||||
if(..())
|
||||
return TRUE
|
||||
|
||||
var/turf/T = ranged_ability_user.loc
|
||||
@@ -148,7 +148,7 @@
|
||||
ranged_mousepointer = 'icons/effects/volt_target.dmi'
|
||||
|
||||
/obj/effect/proc_holder/slab/volt/InterceptClickOn(mob/living/caller, params, atom/target)
|
||||
if(..())
|
||||
if(target == slab || ..()) //we can't cancel
|
||||
return TRUE
|
||||
|
||||
var/turf/T = ranged_ability_user.loc
|
||||
|
||||
@@ -162,14 +162,15 @@
|
||||
resistance_flags = LAVA_PROOF | FIRE_PROOF | ACID_PROOF
|
||||
var/randomsinglesprite = FALSE
|
||||
var/randomspritemax = 2
|
||||
var/sprite_shift = 9
|
||||
|
||||
/obj/item/clockwork/alloy_shards/Initialize()
|
||||
. = ..()
|
||||
if(randomsinglesprite)
|
||||
replace_name_desc()
|
||||
icon_state = "[icon_state][rand(1, randomspritemax)]"
|
||||
pixel_x = rand(-9, 9)
|
||||
pixel_y = rand(-9, 9)
|
||||
pixel_x = rand(-sprite_shift, sprite_shift)
|
||||
pixel_y = rand(-sprite_shift, sprite_shift)
|
||||
|
||||
/obj/item/clockwork/alloy_shards/proc/replace_name_desc()
|
||||
name = "replicant alloy shard"
|
||||
@@ -177,16 +178,21 @@
|
||||
clockwork_desc = "A broken shard of replicant alloy. Can be proselytized for additional power."
|
||||
|
||||
/obj/item/clockwork/alloy_shards/large
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
randomsinglesprite = TRUE
|
||||
icon_state = "shard_large"
|
||||
sprite_shift = 9
|
||||
|
||||
/obj/item/clockwork/alloy_shards/medium
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
randomsinglesprite = TRUE
|
||||
icon_state = "shard_medium"
|
||||
sprite_shift = 10
|
||||
|
||||
/obj/item/clockwork/alloy_shards/medium/gear_bit
|
||||
randomspritemax = 4
|
||||
icon_state = "gear_bit"
|
||||
sprite_shift = 12
|
||||
|
||||
/obj/item/clockwork/alloy_shards/medium/gear_bit/replace_name_desc()
|
||||
name = "gear bit"
|
||||
@@ -200,9 +206,11 @@
|
||||
name = "complex gear bit"
|
||||
|
||||
/obj/item/clockwork/alloy_shards/small
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
randomsinglesprite = TRUE
|
||||
randomspritemax = 3
|
||||
icon_state = "shard_small"
|
||||
sprite_shift = 12
|
||||
|
||||
/obj/item/clockwork/alloy_shards/pinion_lock
|
||||
name = "pinion lock"
|
||||
|
||||
@@ -178,21 +178,24 @@
|
||||
return TRUE
|
||||
|
||||
//A note here; return values are for if we CAN BE PUT ON A TABLE, not IF WE ARE SUCCESSFUL, unless no_table_check is TRUE
|
||||
/obj/item/clockwork/clockwork_proselytizer/proc/proselytize(atom/target, mob/living/user, no_table_check)
|
||||
/obj/item/clockwork/clockwork_proselytizer/proc/proselytize(atom/target, mob/living/user, silent, no_table_check)
|
||||
if(!target || !user)
|
||||
return FALSE
|
||||
if(repairing)
|
||||
to_chat(user, "<span class='warning'>You are currently repairing [repairing] with [src]!</span>")
|
||||
if(!silent)
|
||||
to_chat(user, "<span class='warning'>You are currently repairing [repairing] with [src]!</span>")
|
||||
return FALSE
|
||||
if(recharging)
|
||||
to_chat(user, "<span class='warning'>You are currently recharging [src] from the [recharging.sigil_name]!</span>")
|
||||
if(!silent)
|
||||
to_chat(user, "<span class='warning'>You are currently recharging [src] from the [recharging.sigil_name]!</span>")
|
||||
return FALSE
|
||||
var/list/proselytize_values = target.proselytize_vals(user, src) //relevant values for proselytizing stuff, given as an associated list
|
||||
var/list/proselytize_values = target.proselytize_vals(user, src, silent) //relevant values for proselytizing stuff, given as an associated list
|
||||
if(!islist(proselytize_values))
|
||||
if(proselytize_values != TRUE) //if we get true, fail, but don't send a message for whatever reason
|
||||
if(!isturf(target)) //otherwise, if we didn't get TRUE and the original target wasn't a turf, try to proselytize the turf
|
||||
return proselytize(get_turf(target), user, no_table_check)
|
||||
to_chat(user, "<span class='warning'>[target] cannot be proselytized!</span>")
|
||||
if(!silent)
|
||||
to_chat(user, "<span class='warning'>[target] cannot be proselytized!</span>")
|
||||
if(!no_table_check)
|
||||
return TRUE
|
||||
return FALSE
|
||||
@@ -207,19 +210,22 @@
|
||||
|
||||
var/target_type = target.type
|
||||
|
||||
if(!proselytize_checks(proselytize_values, target, target_type, user))
|
||||
if(!proselytize_checks(proselytize_values, target, target_type, user, silent))
|
||||
return FALSE
|
||||
|
||||
proselytize_values["operation_time"] *= speed_multiplier
|
||||
|
||||
playsound(target, 'sound/machines/click.ogg', 50, 1)
|
||||
if(proselytize_values["operation_time"])
|
||||
user.visible_message("<span class='warning'>[user]'s [name] begins tearing apart [target]!</span>", "<span class='brass'>You begin proselytizing [target]...</span>")
|
||||
if(!silent)
|
||||
user.visible_message("<span class='warning'>[user]'s [name] begins tearing apart [target]!</span>", "<span class='brass'>You begin proselytizing [target]...</span>")
|
||||
if(!do_after(user, proselytize_values["operation_time"], target = target, extra_checks = CALLBACK(src, .proc/proselytize_checks, proselytize_values, target, target_type, user, TRUE)))
|
||||
return FALSE
|
||||
user.visible_message("<span class='warning'>[user]'s [name] covers [target] in golden energy!</span>", "<span class='brass'>You proselytize [target].</span>")
|
||||
if(!silent)
|
||||
user.visible_message("<span class='warning'>[user]'s [name] covers [target] in golden energy!</span>", "<span class='brass'>You proselytize [target].</span>")
|
||||
else
|
||||
user.visible_message("<span class='warning'>[user]'s [name] tears apart [target], covering it in golden energy!</span>", "<span class='brass'>You proselytize [target].</span>")
|
||||
if(!silent)
|
||||
user.visible_message("<span class='warning'>[user]'s [name] tears apart [target], covering it in golden energy!</span>", "<span class='brass'>You proselytize [target].</span>")
|
||||
|
||||
playsound(target, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||
var/new_thing_type = proselytize_values["new_obj_type"]
|
||||
@@ -227,11 +233,12 @@
|
||||
var/turf/T = target
|
||||
T.ChangeTurf(new_thing_type)
|
||||
else
|
||||
if(proselytize_values["dir_in_new"])
|
||||
new new_thing_type(get_turf(target), proselytize_values["spawn_dir"]) //please verify that your new object actually wants to get a dir in New()
|
||||
else
|
||||
var/atom/A = new new_thing_type(get_turf(target))
|
||||
A.setDir(proselytize_values["spawn_dir"])
|
||||
if(new_thing_type)
|
||||
if(proselytize_values["dir_in_new"])
|
||||
new new_thing_type(get_turf(target), proselytize_values["spawn_dir"]) //please verify that your new object actually wants to get a dir in New()
|
||||
else
|
||||
var/atom/A = new new_thing_type(get_turf(target))
|
||||
A.setDir(proselytize_values["spawn_dir"])
|
||||
if(!proselytize_values["no_target_deletion"]) //for some cases where proselytize_vals() modifies the object but doesn't want it deleted
|
||||
qdel(target)
|
||||
modify_stored_power(-proselytize_values["power_cost"])
|
||||
@@ -239,8 +246,13 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
//The following three procs are heavy wizardry.
|
||||
//What these procs do is they take an existing list of values, which they then modify.
|
||||
//This(modifying an existing object, in this case the list) is the only way to get information OUT of a do_after callback, which this is used as.
|
||||
|
||||
//The proselytize check proc.
|
||||
/obj/item/clockwork/clockwork_proselytizer/proc/proselytize_checks(list/proselytize_values, atom/target, expected_type, mob/user, silent) //checked constantly while proselytizing
|
||||
if(!islist(proselytize_values) || !target || QDELETED(target) || !user)
|
||||
if(!islist(proselytize_values) || QDELETED(target) || QDELETED(user))
|
||||
return FALSE
|
||||
if(repairing || recharging)
|
||||
return FALSE
|
||||
@@ -259,11 +271,8 @@
|
||||
return TRUE
|
||||
|
||||
//The repair check proc.
|
||||
//Is dark magic. Can probably kill you.
|
||||
//What this proc does is it takes an existing list of values, which it modifies.
|
||||
//This(modifying an existing object) is the only way to get information OUT of a do_after callback, which this is used as.
|
||||
/obj/item/clockwork/clockwork_proselytizer/proc/proselytizer_repair_checks(list/repair_values, atom/target, mob/user, silent) //Exists entirely to avoid an otherwise unreadable series of checks.
|
||||
if(!islist(repair_values) || !target || QDELETED(target) || !user)
|
||||
if(!islist(repair_values) || QDELETED(target) || QDELETED(user))
|
||||
return FALSE
|
||||
if(isliving(target)) //standard checks for if we can affect the target
|
||||
var/mob/living/L = target
|
||||
@@ -302,9 +311,9 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
//checked constantly while charging from a sigil
|
||||
//The sigil charge check proc.
|
||||
/obj/item/clockwork/clockwork_proselytizer/proc/sigil_charge_checks(list/charge_values, obj/effect/clockwork/sigil/transmission/sigil, mob/user, silent)
|
||||
if(!islist(charge_values) || !sigil || QDELETED(sigil) || !user)
|
||||
if(!islist(charge_values) || QDELETED(sigil) || QDELETED(user))
|
||||
return FALSE
|
||||
if(can_use_power(RATVAR_POWER_CHECK))
|
||||
return FALSE
|
||||
|
||||
@@ -14,8 +14,7 @@
|
||||
verb_ask = "requests"
|
||||
verb_exclaim = "proclaims"
|
||||
verb_yell = "harangues"
|
||||
initial_languages = list(/datum/language/common, /datum/language/ratvar)
|
||||
only_speaks_language = /datum/language/ratvar
|
||||
initial_language_holder = /datum/language_holder/clockmob
|
||||
bubble_icon = "clock"
|
||||
light_color = "#E42742"
|
||||
death_sound = 'sound/magic/clockwork/anima_fragment_death.ogg'
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
if(!check_special_requirements())
|
||||
return FALSE
|
||||
to_chat(invoker, "<span class='warning'>The tendril shivers slightly as it selects a marauder...</span>")
|
||||
var/list/marauder_candidates = pollCandidates("Do you want to play as the clockwork marauder of [invoker.real_name]?", ROLE_SERVANT_OF_RATVAR, null, FALSE, 50, POLL_IGNORE_CLOCKWORK_MARAUDER)
|
||||
var/list/marauder_candidates = pollGhostCandidates("Do you want to play as the clockwork marauder of [invoker.real_name]?", ROLE_SERVANT_OF_RATVAR, null, FALSE, 50, POLL_IGNORE_CLOCKWORK_MARAUDER)
|
||||
if(!check_special_requirements())
|
||||
return FALSE
|
||||
if(!marauder_candidates.len)
|
||||
|
||||
@@ -93,7 +93,7 @@
|
||||
/obj/structure/destructible/clockwork/powered/clockwork_obelisk/process()
|
||||
if(!anchored)
|
||||
return
|
||||
var/obj/effect/clockwork/spatial_gateway/SG = locate(/obj/effect/clockwork/spatial_gateway)
|
||||
var/obj/effect/clockwork/spatial_gateway/SG = locate(/obj/effect/clockwork/spatial_gateway) in loc
|
||||
if(SG && SG.timerid) //it's a valid gateway, we're active
|
||||
icon_state = active_icon
|
||||
density = 0
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
var/mutable_appearance/alert_overlay = mutable_appearance('icons/effects/clockwork_effects.dmi', "ratvar_alert")
|
||||
var/area/A = get_area(src)
|
||||
notify_ghosts("The Justiciar's light calls to you! Reach out to Ratvar in [A.name] to be granted a shell to spread his glory!", null, source = src, alert_overlay = alert_overlay)
|
||||
INVOKE_ASYNC(SSshuttle.emergency, /obj/docking_port/mobile/emergency..proc/request, null, 0, 0)
|
||||
INVOKE_ASYNC(SSshuttle.emergency, /obj/docking_port/mobile/emergency.proc/request, null, 0, null, FALSE, 0)
|
||||
|
||||
/obj/structure/destructible/clockwork/massive/ratvar/Destroy()
|
||||
GLOB.ratvar_awakens--
|
||||
@@ -117,12 +117,10 @@
|
||||
if(!isnewplayer(M))
|
||||
flash_color(M, flash_color="#966400", flash_time=1)
|
||||
shake_camera(M, 4, 3)
|
||||
var/ratvar_chance = min(SSticker.mode.servants_of_ratvar.len, 50)
|
||||
var/narsie_chance = SSticker.mode.cult.len
|
||||
for(var/mob/living/simple_animal/hostile/construct/harvester/C in GLOB.player_list)
|
||||
narsie_chance++
|
||||
var/ratvar_chance = min(LAZYLEN(SSticker.mode.servants_of_ratvar), 50)
|
||||
var/narsie_chance = min(LAZYLEN(SSticker.mode.cult), 50)
|
||||
ratvar_chance = rand(base_victory_chance, ratvar_chance)
|
||||
narsie_chance = rand(base_victory_chance, min(narsie_chance, 50))
|
||||
narsie_chance = rand(base_victory_chance, narsie_chance)
|
||||
if(ratvar_chance > narsie_chance)
|
||||
winner = "Ratvar"
|
||||
break
|
||||
|
||||
@@ -1,34 +1,31 @@
|
||||
|
||||
|
||||
/datum/game_mode
|
||||
var/list/datum/mind/cult = list()
|
||||
var/list/cult_objectives = list()
|
||||
var/eldergod = 1 //for the summon god objective
|
||||
|
||||
/proc/iscultist(mob/living/M)
|
||||
return istype(M) && M.mind && M.mind.has_antag_datum(ANTAG_DATUM_CULT)
|
||||
|
||||
/proc/is_sacrifice_target(datum/mind/mind)
|
||||
if(SSticker.mode.name == "cult")
|
||||
var/datum/game_mode/cult/cult_mode = SSticker.mode
|
||||
if(mind == cult_mode.sacrifice_target)
|
||||
return 1
|
||||
return 0
|
||||
if(mind == GLOB.sac_mind)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/proc/is_convertable_to_cult(mob/living/M)
|
||||
if(!istype(M))
|
||||
return 0
|
||||
return FALSE
|
||||
if(M.mind)
|
||||
if(ishuman(M) && (M.mind.assigned_role in list("Captain", "Chaplain")))
|
||||
return 0
|
||||
return FALSE
|
||||
if(is_sacrifice_target(M.mind))
|
||||
return 0
|
||||
return FALSE
|
||||
if(M.mind.enslaved_to && !iscultist(M.mind.enslaved_to))
|
||||
return 0
|
||||
return FALSE
|
||||
else
|
||||
return 0
|
||||
return FALSE
|
||||
if(M.isloyal() || issilicon(M) || isbot(M) || isdrone(M) || is_servant_of_ratvar(M))
|
||||
return 0 //can't convert machines, shielded, or ratvar's dogs
|
||||
return 1
|
||||
return FALSE //can't convert machines, shielded, or ratvar's dogs
|
||||
return TRUE
|
||||
|
||||
/datum/game_mode/cult
|
||||
name = "cult"
|
||||
@@ -47,14 +44,13 @@
|
||||
<span class='notice'>Crew</span>: Prevent the cult from expanding and drive it out."
|
||||
|
||||
var/finished = 0
|
||||
var/eldergod = 1 //for the summon god objective
|
||||
|
||||
var/acolytes_needed = 10 //for the survive objective
|
||||
var/acolytes_survived = 0
|
||||
|
||||
var/datum/mind/sacrifice_target = null//The target to be sacrificed
|
||||
var/list/cultists_to_cult = list() //the cultists we'll convert
|
||||
|
||||
|
||||
/datum/game_mode/cult/pre_setup()
|
||||
cult_objectives += "sacrifice"
|
||||
cult_objectives += "eldergod"
|
||||
@@ -82,22 +78,6 @@
|
||||
return (cultists_to_cult.len>=required_enemies)
|
||||
|
||||
|
||||
/datum/game_mode/cult/proc/memorize_cult_objectives(datum/mind/cult_mind)
|
||||
for(var/obj_count = 1,obj_count <= cult_objectives.len,obj_count++)
|
||||
var/explanation
|
||||
switch(cult_objectives[obj_count])
|
||||
if("survive")
|
||||
explanation = "Our knowledge must live on. Make sure at least [acolytes_needed] acolytes escape on the shuttle to spread their work on an another station."
|
||||
if("sacrifice")
|
||||
if(sacrifice_target)
|
||||
explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role] via invoking a Sacrifice rune with them on it and three acolytes around it."
|
||||
else
|
||||
explanation = "Free objective."
|
||||
if("eldergod")
|
||||
explanation = "Summon Nar-Sie by invoking the rune 'Summon Nar-Sie' with nine acolytes on it. You must do this after sacrificing your target."
|
||||
to_chat(cult_mind.current, "<B>Objective #[obj_count]</B>: [explanation]")
|
||||
cult_mind.memory += "<B>Objective #[obj_count]</B>: [explanation]<BR>"
|
||||
|
||||
/datum/game_mode/cult/post_setup()
|
||||
modePlayer += cultists_to_cult
|
||||
if("sacrifice" in cult_objectives)
|
||||
@@ -108,15 +88,25 @@
|
||||
if(player.mind && !(player.mind in cultists_to_cult))
|
||||
possible_targets += player.mind
|
||||
if(possible_targets.len > 0)
|
||||
sacrifice_target = pick(possible_targets)
|
||||
if(!sacrifice_target)
|
||||
GLOB.sac_mind = pick(possible_targets)
|
||||
if(!GLOB.sac_mind)
|
||||
message_admins("Cult Sacrifice: ERROR - Null target chosen!")
|
||||
else
|
||||
var/datum/job/sacjob = SSjob.GetJob(GLOB.sac_mind.assigned_role)
|
||||
var/datum/preferences/sacface = GLOB.sac_mind.current.client.prefs
|
||||
var/icon/reshape = get_flat_human_icon(null, sacjob, sacface)
|
||||
reshape.Shift(SOUTH, 4)
|
||||
reshape.Shift(EAST, 1)
|
||||
reshape.Crop(7,4,26,31)
|
||||
reshape.Crop(-5,-3,26,30)
|
||||
GLOB.sac_image = reshape
|
||||
else
|
||||
message_admins("Cult Sacrifice: Could not find unconvertable or convertable target. WELP!")
|
||||
for(var/datum/mind/cult_mind in cultists_to_cult)
|
||||
equip_cultist(cult_mind.current)
|
||||
update_cult_icons_added(cult_mind)
|
||||
to_chat(cult_mind.current, "<span class='userdanger'>You are a member of the cult!</span>")
|
||||
cult_mind.current.playsound_local('sound/ambience/antag/bloodcult.ogg',100,0)//subject to change
|
||||
add_cultist(cult_mind, 0)
|
||||
..()
|
||||
|
||||
@@ -163,12 +153,12 @@
|
||||
cult_mind.current.Paralyse(5)
|
||||
return 1
|
||||
|
||||
/datum/game_mode/proc/remove_cultist(datum/mind/cult_mind, show_message = 1, stun)
|
||||
/datum/game_mode/proc/remove_cultist(datum/mind/cult_mind, silent, stun)
|
||||
if(cult_mind.current)
|
||||
var/datum/antagonist/cult/cult_datum = cult_mind.has_antag_datum(ANTAG_DATUM_CULT)
|
||||
if(!cult_datum)
|
||||
return FALSE
|
||||
cult_datum.silent = show_message
|
||||
cult_datum.silent = silent
|
||||
cult_datum.on_removal()
|
||||
if(stun)
|
||||
cult_mind.current.Paralyse(5)
|
||||
@@ -198,7 +188,7 @@
|
||||
if(cult_objectives.Find("eldergod"))
|
||||
cult_fail += eldergod //1 by default, 0 if the elder god has been summoned at least once
|
||||
if(cult_objectives.Find("sacrifice"))
|
||||
if(sacrifice_target && !GLOB.sacrificed.Find(sacrifice_target)) //if the target has been GLOB.sacrificed, ignore this step. otherwise, add 1 to cult_fail
|
||||
if(GLOB.sac_mind && !GLOB.sac_complete) //if the target has been GLOB.sacrificed, ignore this step. otherwise, add 1 to cult_fail
|
||||
cult_fail++
|
||||
return cult_fail //if any objectives aren't met, failure
|
||||
|
||||
@@ -243,16 +233,12 @@
|
||||
SSblackbox.add_details("cult_objective","cult_survive|FAIL|[acolytes_needed]")
|
||||
SSticker.news_report = CULT_FAILURE
|
||||
if("sacrifice")
|
||||
if(sacrifice_target)
|
||||
if(sacrifice_target in GLOB.sacrificed)
|
||||
explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. <span class='greenannounce'>Success!</span>"
|
||||
SSblackbox.add_details("cult_objective","cult_sacrifice|SUCCESS")
|
||||
else if(sacrifice_target && sacrifice_target.current)
|
||||
explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. <span class='boldannounce'>Fail.</span>"
|
||||
SSblackbox.add_details("cult_objective","cult_sacrifice|FAIL")
|
||||
else
|
||||
explanation = "Sacrifice [sacrifice_target.name], the [sacrifice_target.assigned_role]. <span class='boldannounce'>Fail (Gibbed).</span>"
|
||||
SSblackbox.add_details("cult_objective","cult_sacrifice|FAIL|GIBBED")
|
||||
if(GLOB.sac_complete)
|
||||
explanation = "Sacrifice [GLOB.sac_mind], the [GLOB.sac_mind.assigned_role]. <span class='greenannounce'>Success!</span>"
|
||||
SSblackbox.add_details("cult_objective","cult_sacrifice|SUCCESS")
|
||||
else
|
||||
explanation = "Sacrifice [GLOB.sac_mind], the [GLOB.sac_mind.assigned_role]. <span class='boldannounce'>Fail.</span>"
|
||||
SSblackbox.add_details("cult_objective","cult_sacrifice|FAIL")
|
||||
if("eldergod")
|
||||
if(!eldergod)
|
||||
explanation = "Summon Nar-Sie. <span class='greenannounce'>Success!</span>"
|
||||
@@ -269,12 +255,46 @@
|
||||
return 1
|
||||
|
||||
|
||||
/datum/game_mode/proc/auto_declare_completion_cult()
|
||||
if( cult.len || (SSticker && istype(SSticker.mode,/datum/game_mode/cult)) )
|
||||
var/text = "<br><font size=3><b>The cultists were:</b></font>"
|
||||
for(var/datum/mind/cultist in cult)
|
||||
text += printplayer(cultist)
|
||||
|
||||
text += "<br>"
|
||||
|
||||
to_chat(world, text)
|
||||
/datum/game_mode/proc/datum_cult_completion()
|
||||
var/text = ""
|
||||
var/acolytes_survived = 0
|
||||
for(var/datum/mind/cult_mind in cult)
|
||||
if (cult_mind.current && cult_mind.current.stat != DEAD)
|
||||
if(cult_mind.current.onCentcom() || cult_mind.current.onSyndieBase())
|
||||
acolytes_survived++
|
||||
var/cult_fail = 0
|
||||
cult_fail += eldergod
|
||||
if(!GLOB.sac_complete)
|
||||
cult_fail++
|
||||
if(!cult_fail)
|
||||
SSblackbox.set_details("round_end_result","win - cult win")
|
||||
SSblackbox.set_val("round_end_result",acolytes_survived)
|
||||
to_chat(world, "<span class='greentext'>The cult has succeeded! Nar-sie has snuffed out another torch in the void!</span>")
|
||||
else
|
||||
SSblackbox.set_details("round_end_result","loss - staff stopped the cult")
|
||||
SSblackbox.set_val("round_end_result",acolytes_survived)
|
||||
to_chat(world, "<span class='redtext'>The staff managed to stop the cult! Dark words and heresy are no match for Nanotrasen's finest!</span>")
|
||||
if(cult_objectives.len)
|
||||
text += "<br><b>The cultists' objectives were:</b>"
|
||||
for(var/obj_count in 1 to 2)
|
||||
var/explanation
|
||||
switch(cult_objectives[obj_count])
|
||||
if("sacrifice")
|
||||
if(GLOB.sac_mind)
|
||||
if(GLOB.sac_complete)
|
||||
explanation = "Sacrifice [GLOB.sac_mind], the [GLOB.sac_mind.assigned_role]. <span class='greenannounce'>Success!</span>"
|
||||
SSblackbox.add_details("cult_objective","cult_sacrifice|SUCCESS")
|
||||
else
|
||||
explanation = "Sacrifice [GLOB.sac_mind], the [GLOB.sac_mind.assigned_role]. <span class='boldannounce'>Fail.</span>"
|
||||
SSblackbox.add_details("cult_objective","cult_sacrifice|FAIL")
|
||||
if("eldergod")
|
||||
if(!eldergod)
|
||||
explanation = "Summon Nar-Sie. <span class='greenannounce'>Success!</span>"
|
||||
SSblackbox.add_details("cult_objective","cult_narsie|SUCCESS")
|
||||
SSticker.news_report = CULT_SUMMON
|
||||
else
|
||||
explanation = "Summon Nar-Sie. <span class='boldannounce'>Fail.</span>"
|
||||
SSblackbox.add_details("cult_objective","cult_narsie|FAIL")
|
||||
SSticker.news_report = CULT_FAILURE
|
||||
text += "<br><B>Objective #[obj_count]</B>: [explanation]"
|
||||
to_chat(world, text)
|
||||
@@ -1,17 +1,21 @@
|
||||
// Contains cult communion, guide, and cult master abilities
|
||||
#define MARK_COOLDOWN
|
||||
|
||||
/datum/action/innate/cultcomm
|
||||
name = "Communion"
|
||||
button_icon_state = "cult_comms"
|
||||
/datum/action/innate/cult
|
||||
background_icon_state = "bg_demon"
|
||||
buttontooltipstyle = "cult"
|
||||
check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_CONSCIOUS
|
||||
|
||||
/datum/action/innate/cultcomm/IsAvailable()
|
||||
/datum/action/innate/cult/IsAvailable()
|
||||
if(!iscultist(owner))
|
||||
return 0
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/action/innate/cultcomm/Activate()
|
||||
/datum/action/innate/cult/comm
|
||||
name = "Communion"
|
||||
button_icon_state = "cult_comms"
|
||||
|
||||
/datum/action/innate/cult/comm/Activate()
|
||||
var/input = stripped_input(usr, "Please choose a message to tell to the other acolytes.", "Voice of Blood", "")
|
||||
if(!input || !IsAvailable())
|
||||
return
|
||||
@@ -19,11 +23,22 @@
|
||||
cultist_commune(usr, input)
|
||||
|
||||
/proc/cultist_commune(mob/living/user, message)
|
||||
var/my_message
|
||||
if(!message)
|
||||
return
|
||||
user.whisper("O bidai nabora se[pick("'","`")]sma!")
|
||||
user.whisper("O bidai nabora se[pick("'","`")]sma!", language = /datum/language/common)
|
||||
user.whisper(html_decode(message))
|
||||
var/my_message = "<span class='cultitalic'><b>[(ishuman(user) ? "Acolyte" : "Construct")] [findtextEx(user.name, user.real_name) ? user.name : "[user.real_name] (as [user.name])"]:</b> [message]</span>"
|
||||
var/title = "Acolyte"
|
||||
var/span = "cultitalic"
|
||||
if(user.mind && user.mind.has_antag_datum(ANTAG_DATUM_CULT_MASTER))
|
||||
span = "cultlarge"
|
||||
if(ishuman(user))
|
||||
title = "Master"
|
||||
else
|
||||
title = "Lord"
|
||||
else if(!ishuman(user))
|
||||
title = "Construct"
|
||||
my_message = "<span class='[span]'><b>[title] [findtextEx(user.name, user.real_name) ? user.name : "[user.real_name] (as [user.name])"]:</b> [message]</span>"
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
if(iscultist(M))
|
||||
to_chat(M, my_message)
|
||||
@@ -65,3 +80,223 @@
|
||||
popup.set_content(text)
|
||||
popup.open()
|
||||
return 1
|
||||
|
||||
/mob/living/proc/cult_master()
|
||||
set category = "Cultist"
|
||||
set name = "Assert Leadership"
|
||||
pollCultists(src) // This proc handles the distribution of cult master actions
|
||||
|
||||
/datum/action/innate/cult/mastervote
|
||||
name = "Assert Leadership"
|
||||
button_icon_state = "cultvote"
|
||||
|
||||
/datum/action/innate/cult/mastervote/IsAvailable()
|
||||
if(GLOB.cult_vote_called)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/action/innate/cult/mastervote/Activate()
|
||||
pollCultists(owner)
|
||||
|
||||
/proc/pollCultists(var/mob/living/Nominee) //Cult Master Poll
|
||||
if(world.time < CULT_POLL_WAIT)
|
||||
to_chat(Nominee, "It would be premature to select a leader while everyone is still settling in, try again in [round((CULT_POLL_WAIT-world.time)/10)] seconds.")
|
||||
return
|
||||
GLOB.cult_vote_called = TRUE //somebody's trying to be a master, make sure we don't let anyone else try
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
if(B.current)
|
||||
B.current.update_action_buttons_icon()
|
||||
if(!B.current.incapacitated())
|
||||
B.current << 'sound/hallucinations/im_here1.ogg'
|
||||
to_chat(B.current, "<span class='cultlarge'>Acolyte [Nominee] has asserted that they are worthy of leading the cult. A vote will be called shortly.</span>")
|
||||
sleep(100)
|
||||
var/list/asked_cultists = list()
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
if(B.current && B.current != Nominee && !B.current.incapacitated())
|
||||
B.current << 'sound/magic/exit_blood.ogg'
|
||||
asked_cultists += B.current
|
||||
var/list/yes_voters = pollCandidates("[Nominee] seeks to lead your cult, do you support [Nominee.p_them()]?", poll_time = 300, group = asked_cultists)
|
||||
if(QDELETED(Nominee) || Nominee.incapacitated())
|
||||
GLOB.cult_vote_called = FALSE
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
if(B.current)
|
||||
B.current.update_action_buttons_icon()
|
||||
if(!B.current.incapacitated())
|
||||
to_chat(B.current,"<span class='cultlarge'>[Nominee] has died in the process of attempting to win the cult's support!")
|
||||
return FALSE
|
||||
if(!Nominee.mind)
|
||||
GLOB.cult_vote_called = FALSE
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
if(B.current)
|
||||
B.current.update_action_buttons_icon()
|
||||
if(!B.current.incapacitated())
|
||||
to_chat(B.current,"<span class='cultlarge'>[Nominee] has gone catatonic in the process of attempting to win the cult's support!")
|
||||
return FALSE
|
||||
if(LAZYLEN(yes_voters) <= LAZYLEN(asked_cultists) * 0.5)
|
||||
GLOB.cult_vote_called = FALSE
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
if(B.current)
|
||||
B.current.update_action_buttons_icon()
|
||||
if(!B.current.incapacitated())
|
||||
to_chat(B.current, "<span class='cultlarge'>[Nominee] could not win the cult's support and shall continue to serve as an acolyte.")
|
||||
return FALSE
|
||||
GLOB.cult_mastered = TRUE
|
||||
SSticker.mode.remove_cultist(Nominee.mind, TRUE)
|
||||
Nominee.mind.add_antag_datum(ANTAG_DATUM_CULT_MASTER)
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
if(B.current)
|
||||
for(var/datum/action/innate/cult/mastervote/vote in B.current.actions)
|
||||
vote.Remove(B.current)
|
||||
if(!B.current.incapacitated())
|
||||
to_chat(B.current,"<span class='cultlarge'>[Nominee] has won the cult's support and is now their master. Follow [Nominee.p_their()] orders to the best of your ability!")
|
||||
return TRUE
|
||||
|
||||
/datum/action/innate/cult/master/IsAvailable()
|
||||
if(!owner.mind || !owner.mind.has_antag_datum(ANTAG_DATUM_CULT_MASTER) || GLOB.cult_narsie)
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/datum/action/innate/cult/master/finalreck
|
||||
name = "Final Reckoning"
|
||||
desc = "A single-use spell that brings the entire cult to the master's location."
|
||||
button_icon_state = "sintouch"
|
||||
|
||||
/datum/action/innate/cult/master/finalreck/Activate()
|
||||
for(var/i in 1 to 4)
|
||||
chant(i)
|
||||
var/list/destinations = list()
|
||||
for(var/turf/T in orange(1, owner))
|
||||
if(!is_blocked_turf(T, TRUE))
|
||||
destinations += T
|
||||
if(!LAZYLEN(destinations))
|
||||
to_chat(owner, "<span class='warning'>You need more space to summon the cult!</span>")
|
||||
return
|
||||
if(do_after(owner, 30, target = owner))
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
if(B.current && B.current.stat != DEAD)
|
||||
var/turf/mobloc = get_turf(B.current)
|
||||
switch(i)
|
||||
if(1)
|
||||
new /obj/effect/overlay/temp/cult/sparks(mobloc, B.current.dir)
|
||||
playsound(mobloc, "sparks", 50, 1)
|
||||
if(2)
|
||||
new /obj/effect/overlay/temp/dir_setting/cult/phase/out(mobloc, B.current.dir)
|
||||
playsound(mobloc, "sparks", 75, 1)
|
||||
if(3)
|
||||
new /obj/effect/overlay/temp/dir_setting/cult/phase(mobloc, B.current.dir)
|
||||
playsound(mobloc, "sparks", 100, 1)
|
||||
if(4)
|
||||
playsound(mobloc, 'sound/magic/exit_blood.ogg', 100, 1)
|
||||
if(B.current != owner)
|
||||
var/turf/final = pick(destinations)
|
||||
if(istype(B.current.loc, /obj/item/device/soulstone))
|
||||
var/obj/item/device/soulstone/S = B.current.loc
|
||||
S.release_shades(owner)
|
||||
B.current.setDir(SOUTH)
|
||||
new /obj/effect/overlay/temp/cult/blood(final)
|
||||
addtimer(CALLBACK(B.current, /mob/.proc/reckon, final), 10)
|
||||
else
|
||||
return
|
||||
GLOB.reckoning_complete = TRUE
|
||||
Remove(owner)
|
||||
|
||||
/mob/proc/reckon(turf/final)
|
||||
new /obj/effect/overlay/temp/cult/blood/out(get_turf(src))
|
||||
forceMove(final)
|
||||
|
||||
/datum/action/innate/cult/master/finalreck/proc/chant(chant_number)
|
||||
switch(chant_number)
|
||||
if(1)
|
||||
owner.say("C'arta forbici!", language = /datum/language/common)
|
||||
if(2)
|
||||
owner.say("Pleggh e'ntrath!", language = /datum/language/common)
|
||||
playsound(get_turf(owner),'sound/magic/clockwork/narsie_attack.ogg', 50, 1)
|
||||
if(3)
|
||||
owner.say("Barhah hra zar'garis!", language = /datum/language/common)
|
||||
playsound(get_turf(owner),'sound/magic/clockwork/narsie_attack.ogg', 75, 1)
|
||||
if(4)
|
||||
owner.say("N'ath reth sh'yro eth d'rekkathnor!!!", language = /datum/language/common)
|
||||
playsound(get_turf(owner),'sound/magic/clockwork/narsie_attack.ogg', 100, 1)
|
||||
|
||||
/datum/action/innate/cult/master/cultmark
|
||||
name = "Mark Target"
|
||||
desc = "Marks a target for the cult."
|
||||
button_icon_state = "cult_mark"
|
||||
var/obj/effect/proc_holder/cultmark/CM
|
||||
var/cooldown = 0
|
||||
var/base_cooldown = 1200
|
||||
|
||||
/datum/action/innate/cult/master/cultmark/New()
|
||||
CM = new()
|
||||
CM.attached_action = src
|
||||
..()
|
||||
|
||||
/datum/action/innate/cult/master/cultmark/IsAvailable()
|
||||
if(!owner.mind || !owner.mind.has_antag_datum(ANTAG_DATUM_CULT_MASTER))
|
||||
return FALSE
|
||||
if(cooldown > world.time)
|
||||
if(!CM.active)
|
||||
owner << "<span class='cultlarge'><b>You need to wait [round((cooldown - world.time) * 0.1)] seconds before you can mark another target!</b></span>"
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/action/innate/cult/master/cultmark/Destroy()
|
||||
QDEL_NULL(CM)
|
||||
return ..()
|
||||
|
||||
/datum/action/innate/cult/master/cultmark/Activate()
|
||||
CM.toggle(owner) //the important bit
|
||||
return TRUE
|
||||
|
||||
/obj/effect/proc_holder/cultmark
|
||||
active = FALSE
|
||||
ranged_mousepointer = 'icons/effects/cult_target.dmi'
|
||||
var/datum/action/innate/cult/master/cultmark/attached_action
|
||||
|
||||
/obj/effect/proc_holder/cultmark/Destroy()
|
||||
attached_action = null
|
||||
return ..()
|
||||
|
||||
/obj/effect/proc_holder/cultmark/proc/toggle(mob/user)
|
||||
if(active)
|
||||
remove_ranged_ability("<span class='cult'>You cease the marking ritual.</span>")
|
||||
else
|
||||
add_ranged_ability(user, "<span class='cult'>You prepare to mark a target for your cult...</span>")
|
||||
|
||||
/obj/effect/proc_holder/cultmark/InterceptClickOn(mob/living/caller, params, atom/target)
|
||||
if(..())
|
||||
return
|
||||
if(ranged_ability_user.incapacitated())
|
||||
remove_ranged_ability()
|
||||
return
|
||||
var/turf/T = get_turf(ranged_ability_user)
|
||||
if(!isturf(T))
|
||||
return FALSE
|
||||
if(target in view(7, get_turf(ranged_ability_user)))
|
||||
GLOB.blood_target = target
|
||||
var/area/A = get_area(target)
|
||||
attached_action.cooldown = world.time + attached_action.base_cooldown
|
||||
addtimer(CALLBACK(attached_action.owner, /mob.proc/update_action_buttons_icon), attached_action.base_cooldown)
|
||||
GLOB.blood_target_image = image('icons/effects/cult_target.dmi', target, "glow", ABOVE_MOB_LAYER)
|
||||
GLOB.blood_target_image.appearance_flags = RESET_COLOR
|
||||
GLOB.blood_target_image.pixel_x = -target.pixel_x
|
||||
GLOB.blood_target_image.pixel_y = -target.pixel_y
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
if(B.current && B.current.stat != DEAD && B.current.client)
|
||||
to_chat(B.current, "<span class='cultlarge'><b>Master [ranged_ability_user] has marked [GLOB.blood_target] in the [A.name] as the cult's top priority, get there immediately!</b></span>")
|
||||
B.current << pick(sound('sound/hallucinations/over_here2.ogg',0,1,75), sound('sound/hallucinations/over_here3.ogg',0,1,75))
|
||||
B.current.client.images += GLOB.blood_target_image
|
||||
attached_action.owner.update_action_buttons_icon()
|
||||
remove_ranged_ability("<span class='cult'>The marking rite is complete! It will last for 90 seconds.</span>")
|
||||
GLOB.blood_target_reset_timer = addtimer(CALLBACK(GLOBAL_PROC, .proc/reset_blood_target), 900, TIMER_STOPPABLE)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/proc/reset_blood_target()
|
||||
for(var/datum/mind/B in SSticker.mode.cult)
|
||||
if(B.current && B.current.stat != DEAD && B.current.client)
|
||||
if(GLOB.blood_target)
|
||||
to_chat(B.current,"<span class='cultlarge'><b>The blood mark has expired!</b></span>")
|
||||
B.current.client.images -= GLOB.blood_target_image
|
||||
QDEL_NULL(GLOB.blood_target_image)
|
||||
GLOB.blood_target = null
|
||||
|
||||
@@ -26,6 +26,11 @@
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/melee/cultblade/ghost
|
||||
name = "eldritch sword"
|
||||
force = 19
|
||||
flags = NODROP|DROPDEL
|
||||
|
||||
/obj/item/weapon/melee/cultblade/pickup(mob/living/user)
|
||||
..()
|
||||
if(!iscultist(user))
|
||||
@@ -100,12 +105,18 @@
|
||||
icon_state = "cult_hoodalt"
|
||||
item_state = "cult_hoodalt"
|
||||
|
||||
/obj/item/clothing/head/culthood/alt/ghost
|
||||
flags = NODROP|DROPDEL
|
||||
|
||||
/obj/item/clothing/suit/cultrobes/alt
|
||||
name = "cultist robes"
|
||||
desc = "An armored set of robes worn by the followers of Nar-Sie."
|
||||
icon_state = "cultrobesalt"
|
||||
item_state = "cultrobesalt"
|
||||
|
||||
/obj/item/clothing/suit/cultrobes/alt/ghost
|
||||
flags = NODROP|DROPDEL
|
||||
|
||||
|
||||
/obj/item/clothing/head/magus
|
||||
name = "magus helm"
|
||||
@@ -203,7 +214,7 @@
|
||||
/obj/item/clothing/suit/hooded/cultrobes/cult_shield/worn_overlays(isinhands)
|
||||
. = list()
|
||||
if(!isinhands && current_charges)
|
||||
. += mutable_appearance('icons/effects/effects.dmi', "shield-cult", MOB_LAYER + 0.01)
|
||||
. += mutable_appearance('icons/effects/cult_effects.dmi', "shield-cult", MOB_LAYER + 0.01)
|
||||
|
||||
/obj/item/clothing/suit/hooded/cultrobes/berserker
|
||||
name = "flagellant's robes"
|
||||
@@ -213,7 +224,7 @@
|
||||
flags_inv = HIDEJUMPSUIT
|
||||
allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade)
|
||||
body_parts_covered = CHEST|GROIN|LEGS|ARMS
|
||||
armor = list(melee = -50, bullet = -50, laser = -100,energy = -50, bomb = -50, bio = -50, rad = -50, fire = 0, acid = 0)
|
||||
armor = list(melee = -50, bullet = -50, laser = -50,energy = -50, bomb = -50, bio = -50, rad = -50, fire = 0, acid = 0)
|
||||
slowdown = -1
|
||||
hoodtype = /obj/item/clothing/head/hooded/berserkerhood
|
||||
|
||||
|
||||
@@ -197,35 +197,30 @@ This file contains the arcane tome files.
|
||||
if(!src || QDELETED(src) || !Adjacent(user) || user.incapacitated() || !check_rune_turf(Turf, user))
|
||||
return
|
||||
if(ispath(rune_to_scribe, /obj/effect/rune/narsie))
|
||||
if(SSticker.mode.name == "cult")
|
||||
var/datum/game_mode/cult/cult_mode = SSticker.mode
|
||||
if(!("eldergod" in cult_mode.cult_objectives))
|
||||
to_chat(user, "<span class='warning'>Nar-Sie does not wish to be summoned!</span>")
|
||||
return
|
||||
if(cult_mode.sacrifice_target && !(cult_mode.sacrifice_target in GLOB.sacrificed))
|
||||
to_chat(user, "<span class='warning'>The sacrifice is not complete. The portal would lack the power to open if you tried!</span>")
|
||||
return
|
||||
if(!cult_mode.eldergod)
|
||||
to_chat(user, "<span class='cultlarge'>\"I am already here. There is no need to try to summon me now.\"</span>")
|
||||
return
|
||||
if((loc.z && loc.z != ZLEVEL_STATION) || !A.blob_allowed)
|
||||
to_chat(user, "<span class='warning'>The Geometer is not interested in lesser locations; the station is the prize!</span>")
|
||||
return
|
||||
var/confirm_final = alert(user, "This is the FINAL step to summon Nar-Sie, it is a long, painful ritual and the crew will be alerted to your presence", "Are you prepared for the final battle?", "My life for Nar-Sie!", "No")
|
||||
if(confirm_final == "No")
|
||||
to_chat(user, "<span class='cult'>You decide to prepare further before scribing the rune.</span>")
|
||||
return
|
||||
Turf = get_turf(user)
|
||||
A = get_area(src)
|
||||
if(!check_rune_turf(Turf, user) || (loc.z && loc.z != ZLEVEL_STATION)|| !A.blob_allowed)
|
||||
return
|
||||
priority_announce("Figments from an eldritch god are being summoned by [user] into [A.map_name] from an unknown dimension. Disrupt the ritual at all costs!","Central Command Higher Dimensionsal Affairs", 'sound/AI/spanomalies.ogg')
|
||||
for(var/B in spiral_range_turfs(1, user, 1))
|
||||
var/obj/structure/emergency_shield/sanguine/N = new(B)
|
||||
shields += N
|
||||
else
|
||||
if(!("eldergod" in SSticker.mode.cult_objectives))
|
||||
to_chat(user, "<span class='warning'>Nar-Sie does not wish to be summoned!</span>")
|
||||
return
|
||||
if(!GLOB.sac_complete)
|
||||
to_chat(user, "<span class='warning'>The sacrifice is not complete. The portal would lack the power to open if you tried!</span>")
|
||||
return
|
||||
if(!SSticker.mode.eldergod)
|
||||
to_chat(user, "<span class='cultlarge'>\"I am already here. There is no need to try to summon me now.\"</span>")
|
||||
return
|
||||
if((loc.z && loc.z != ZLEVEL_STATION) || !A.blob_allowed)
|
||||
to_chat(user, "<span class='warning'>The Geometer is not interested in lesser locations; the station is the prize!</span>")
|
||||
return
|
||||
var/confirm_final = alert(user, "This is the FINAL step to summon Nar-Sie; it is a long, painful ritual and the crew will be alerted to your presence", "Are you prepared for the final battle?", "My life for Nar-Sie!", "No")
|
||||
if(confirm_final == "No")
|
||||
to_chat(user, "<span class='cult'>You decide to prepare further before scribing the rune.</span>")
|
||||
return
|
||||
Turf = get_turf(user)
|
||||
A = get_area(src)
|
||||
if(!check_rune_turf(Turf, user) || (loc.z && loc.z != ZLEVEL_STATION)|| !A.blob_allowed)
|
||||
return
|
||||
priority_announce("Figments from an eldritch god are being summoned by [user] into [A.map_name] from an unknown dimension. Disrupt the ritual at all costs!","Central Command Higher Dimensional Affairs", 'sound/AI/spanomalies.ogg')
|
||||
for(var/B in spiral_range_turfs(1, user, 1))
|
||||
var/obj/structure/emergency_shield/sanguine/N = new(B)
|
||||
shields += N
|
||||
user.visible_message("<span class='warning'>[user] [user.blood_volume ? "cuts open their arm and begins writing in their own blood":"begins sketching out a strange design"]!</span>", \
|
||||
"<span class='cult'>You [user.blood_volume ? "slice open your arm and ":""]begin drawing a sigil of the Geometer.</span>")
|
||||
if(user.blood_volume)
|
||||
|
||||
@@ -0,0 +1,70 @@
|
||||
//after a delay, creates a rune below you. for constructs creating runes.
|
||||
/datum/action/innate/cult/create_rune
|
||||
background_icon_state = "bg_cult"
|
||||
var/obj/effect/rune/rune_type
|
||||
var/cooldown = 0
|
||||
var/base_cooldown = 900
|
||||
var/scribe_time = 100
|
||||
var/damage_interrupt = TRUE
|
||||
var/action_interrupt = TRUE
|
||||
var/obj/effect/overlay/temp/cult/rune_spawn/rune_word_type
|
||||
var/obj/effect/overlay/temp/cult/rune_spawn/rune_innerring_type
|
||||
var/obj/effect/overlay/temp/cult/rune_spawn/rune_center_type
|
||||
var/rune_color
|
||||
|
||||
/datum/action/innate/cult/create_rune/IsAvailable()
|
||||
if(!rune_type || cooldown > world.time)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/action/innate/cult/create_rune/Activate()
|
||||
var/chosen_keyword
|
||||
if(!isturf(owner.loc))
|
||||
to_chat(owner, "<span class='warning>You need more space to scribe a rune!</span>")
|
||||
return
|
||||
if(initial(rune_type.req_keyword))
|
||||
chosen_keyword = stripped_input(owner, "Enter a keyword for the new rune.", "Words of Power")
|
||||
if(!chosen_keyword)
|
||||
return
|
||||
//the outer ring is always the same across all runes
|
||||
var/obj/effect/overlay/temp/cult/rune_spawn/R1 = new(owner.loc, scribe_time, rune_color)
|
||||
//the rest are not always the same, so we need types for em
|
||||
var/obj/effect/overlay/temp/cult/rune_spawn/R2
|
||||
if(rune_word_type)
|
||||
R2 = new rune_word_type(owner.loc, scribe_time, rune_color)
|
||||
var/obj/effect/overlay/temp/cult/rune_spawn/R3
|
||||
if(rune_innerring_type)
|
||||
R3 = new rune_innerring_type(owner.loc, scribe_time, rune_color)
|
||||
var/obj/effect/overlay/temp/cult/rune_spawn/R4
|
||||
if(rune_center_type)
|
||||
R4 = new rune_center_type(owner.loc, scribe_time, rune_color)
|
||||
|
||||
cooldown = base_cooldown + world.time
|
||||
owner.update_action_buttons_icon()
|
||||
addtimer(CALLBACK(owner, /mob.proc/update_action_buttons_icon), base_cooldown)
|
||||
var/list/health
|
||||
if(damage_interrupt && isliving(owner))
|
||||
var/mob/living/L = owner
|
||||
health = list("health" = L.health)
|
||||
if(do_after(owner, scribe_time, target = owner, extra_checks = CALLBACK(owner, /mob.proc/break_do_after_checks, health, action_interrupt)))
|
||||
var/obj/effect/rune/new_rune = new rune_type(owner.loc)
|
||||
new_rune.keyword = chosen_keyword
|
||||
else
|
||||
qdel(R1)
|
||||
if(R2)
|
||||
qdel(R2)
|
||||
if(R3)
|
||||
qdel(R3)
|
||||
if(R4)
|
||||
qdel(R4)
|
||||
cooldown = 0
|
||||
owner.update_action_buttons_icon()
|
||||
|
||||
//teleport rune
|
||||
/datum/action/innate/cult/create_rune/tele
|
||||
button_icon_state = "telerune"
|
||||
rune_type = /obj/effect/rune/teleport
|
||||
rune_word_type = /obj/effect/overlay/temp/cult/rune_spawn/rune2
|
||||
rune_innerring_type = /obj/effect/overlay/temp/cult/rune_spawn/rune2/inner
|
||||
rune_center_type = /obj/effect/overlay/temp/cult/rune_spawn/rune2/center
|
||||
rune_color = RUNE_COLOR_TELEPORT
|
||||
@@ -24,18 +24,18 @@ To draw a rune, use an arcane tome.
|
||||
icon_state = "1"
|
||||
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
|
||||
layer = LOW_OBJ_LAYER
|
||||
color = "#FF0000"
|
||||
color = RUNE_COLOR_RED
|
||||
|
||||
var/invocation = "Aiy ele-mayo!" //This is said by cultists when the rune is invoked.
|
||||
var/req_cultists = 1 //The amount of cultists required around the rune to invoke it. If only 1, any cultist can invoke it.
|
||||
var/req_cultists_text //if we have a description override for required cultists to invoke
|
||||
var/rune_in_use = 0 // Used for some runes, this is for when you want a rune to not be usable when in use.
|
||||
var/rune_in_use = FALSE // Used for some runes, this is for when you want a rune to not be usable when in use.
|
||||
|
||||
var/scribe_delay = 50 //how long the rune takes to create
|
||||
var/scribe_damage = 0.1 //how much damage you take doing it
|
||||
|
||||
var/allow_excess_invokers = 0 //if we allow excess invokers when being invoked
|
||||
var/construct_invoke = 1 //if constructs can invoke it
|
||||
var/allow_excess_invokers = FALSE //if we allow excess invokers when being invoked
|
||||
var/construct_invoke = TRUE //if constructs can invoke it
|
||||
|
||||
var/req_keyword = 0 //If the rune requires a keyword - go figure amirite
|
||||
var/keyword //The actual keyword for the rune
|
||||
@@ -136,7 +136,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
if(invocation)
|
||||
for(var/M in invokers)
|
||||
var/mob/living/L = M
|
||||
L.say(invocation)
|
||||
L.say(invocation, language = /datum/language/common)
|
||||
do_invoke_glow()
|
||||
|
||||
/obj/effect/rune/proc/do_invoke_glow()
|
||||
@@ -191,7 +191,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
cultist_desc = "transforms paper into powerful magic talismans."
|
||||
invocation = "H'drak v'loso, mir'kanas verbot!"
|
||||
icon_state = "3"
|
||||
color = "#0000FF"
|
||||
color = RUNE_COLOR_TALISMAN
|
||||
|
||||
/obj/effect/rune/imbue/invoke(var/list/invokers)
|
||||
var/mob/living/user = invokers[1] //the first invoker is always the user
|
||||
@@ -228,14 +228,12 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
var/obj/item/weapon/paper/paper_to_imbue = papers_on_rune[1]
|
||||
..()
|
||||
visible_message("<span class='warning'>Dark power begins to channel into the paper!</span>")
|
||||
rune_in_use = 1
|
||||
if(!do_after(user, initial(talisman_type.creation_time), target = paper_to_imbue))
|
||||
rune_in_use = 0
|
||||
return
|
||||
new talisman_type(get_turf(src))
|
||||
visible_message("<span class='warning'>[src] glows with power, and bloody images form themselves on [paper_to_imbue].</span>")
|
||||
qdel(paper_to_imbue)
|
||||
rune_in_use = 0
|
||||
rune_in_use = TRUE
|
||||
if(do_after(user, initial(talisman_type.creation_time), target = paper_to_imbue))
|
||||
new talisman_type(get_turf(src))
|
||||
visible_message("<span class='warning'>[src] glows with power, and bloody images form themselves on [paper_to_imbue].</span>")
|
||||
qdel(paper_to_imbue)
|
||||
rune_in_use = FALSE
|
||||
|
||||
/obj/effect/rune/imbue/proc/checkpapers()
|
||||
. = list()
|
||||
@@ -248,8 +246,8 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
cultist_desc = "warps everything above it to another chosen teleport rune."
|
||||
invocation = "Sas'so c'arta forbici!"
|
||||
icon_state = "2"
|
||||
color = "#551A8B"
|
||||
req_keyword = 1
|
||||
color = RUNE_COLOR_TELEPORT
|
||||
req_keyword = TRUE
|
||||
var/listkey
|
||||
|
||||
/obj/effect/rune/teleport/Initialize(mapload, set_keyword)
|
||||
@@ -296,15 +294,15 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
to_chat(user, "<span class='warning'>The target rune is blocked. Attempting to teleport to it would be massively unwise.</span>")
|
||||
fail_invoke()
|
||||
return
|
||||
var/movedsomething = 0
|
||||
var/moveuserlater = 0
|
||||
var/movedsomething = FALSE
|
||||
var/moveuserlater = FALSE
|
||||
for(var/atom/movable/A in T)
|
||||
if(A == user)
|
||||
moveuserlater = 1
|
||||
movedsomething = 1
|
||||
moveuserlater = TRUE
|
||||
movedsomething = TRUE
|
||||
continue
|
||||
if(!A.anchored)
|
||||
movedsomething = 1
|
||||
movedsomething = TRUE
|
||||
A.forceMove(target)
|
||||
if(movedsomething)
|
||||
..()
|
||||
@@ -324,9 +322,9 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
req_cultists_text = "2 for conversion, 3 for living sacrifices and sacrifice targets."
|
||||
invocation = "Mah'weyh pleggh at e'ntrath!"
|
||||
icon_state = "3"
|
||||
color = "#FFFFFF"
|
||||
color = RUNE_COLOR_OFFER
|
||||
req_cultists = 1
|
||||
allow_excess_invokers = 1
|
||||
allow_excess_invokers = TRUE
|
||||
rune_in_use = FALSE
|
||||
|
||||
/obj/effect/rune/convert/do_invoke_glow()
|
||||
@@ -347,7 +345,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
rune_in_use = TRUE
|
||||
visible_message("<span class='warning'>[src] pulses blood red!</span>")
|
||||
var/oldcolor = color
|
||||
color = "#7D1717"
|
||||
color = RUNE_COLOR_DARKRED
|
||||
var/mob/living/L = pick(myriad_targets)
|
||||
var/is_clock = is_servant_of_ratvar(L)
|
||||
var/is_convertable = is_convertable_to_cult(L)
|
||||
@@ -398,23 +396,23 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
return 1
|
||||
|
||||
/obj/effect/rune/convert/proc/do_sacrifice(mob/living/sacrificial, list/invokers)
|
||||
var/big_sac = FALSE
|
||||
if((((ishuman(sacrificial) || iscyborg(sacrificial)) && sacrificial.stat != DEAD) || is_sacrifice_target(sacrificial.mind)) && invokers.len < 3)
|
||||
for(var/M in invokers)
|
||||
to_chat(M, "<span class='cultitalic'>[sacrificial] is too greatly linked to the world! You need three acolytes!</span>")
|
||||
log_game("Offer rune failed - not enough acolytes and target is living or sac target")
|
||||
return FALSE
|
||||
var/sacrifice_fulfilled = FALSE
|
||||
|
||||
if(sacrificial.mind)
|
||||
GLOB.sacrificed += sacrificial.mind
|
||||
if(is_sacrifice_target(sacrificial.mind))
|
||||
sacrifice_fulfilled = TRUE
|
||||
GLOB.sac_complete = TRUE
|
||||
big_sac = TRUE
|
||||
else
|
||||
GLOB.sacrificed += sacrificial
|
||||
|
||||
new /obj/effect/overlay/temp/cult/sac(get_turf(src))
|
||||
for(var/M in invokers)
|
||||
if(sacrifice_fulfilled)
|
||||
if(big_sac)
|
||||
to_chat(M, "<span class='cultlarge'>\"Yes! This is the one I desire! You have done well.\"</span>")
|
||||
else
|
||||
if(ishuman(sacrificial) || iscyborg(sacrificial))
|
||||
@@ -444,14 +442,13 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
invocation = "TOK-LYR RQA-NAP G'OLT-ULOFT!!"
|
||||
req_cultists = 9
|
||||
icon = 'icons/effects/96x96.dmi'
|
||||
color = "#7D1717"
|
||||
color = RUNE_COLOR_DARKRED
|
||||
icon_state = "rune_large"
|
||||
pixel_x = -32 //So the big ol' 96x96 sprite shows up right
|
||||
pixel_y = -32
|
||||
scribe_delay = 450 //how long the rune takes to create
|
||||
scribe_damage = 40.1 //how much damage you take doing it
|
||||
var/used
|
||||
var/ignore_gamemode = FALSE
|
||||
var/used = FALSE
|
||||
|
||||
/obj/effect/rune/narsie/Initialize(mapload, set_keyword)
|
||||
. = ..()
|
||||
@@ -470,34 +467,21 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
if(z != ZLEVEL_STATION)
|
||||
return
|
||||
|
||||
var/datum/game_mode/cult/cult_mode
|
||||
|
||||
if(SSticker.mode.name == "cult")
|
||||
cult_mode = SSticker.mode
|
||||
|
||||
if(!cult_mode && !ignore_gamemode)
|
||||
for(var/M in invokers)
|
||||
to_chat(M, "<span class='warning'>Nar-Sie does not respond!</span>")
|
||||
fail_invoke()
|
||||
log_game("Summon Nar-Sie rune failed - gametype is not cult")
|
||||
return
|
||||
|
||||
if(locate(/obj/singularity/narsie) in GLOB.poi_list)
|
||||
for(var/M in invokers)
|
||||
to_chat(M, "<span class='warning'>Nar-Sie is already on this plane!</span>")
|
||||
log_game("Summon Nar-Sie rune failed - already summoned")
|
||||
return
|
||||
//BEGIN THE SUMMONING
|
||||
used = 1
|
||||
used = TRUE
|
||||
..()
|
||||
send_to_playing_players('sound/effects/dimensional_rend.ogg') //There used to be a message for this but every time it was changed it got edgier so I removed it
|
||||
send_to_playing_players('sound/effects/dimensional_rend.ogg')
|
||||
var/turf/T = get_turf(src)
|
||||
sleep(40)
|
||||
if(src)
|
||||
color = "#FF0000"
|
||||
if(cult_mode)
|
||||
cult_mode.eldergod = 0
|
||||
new /obj/singularity/narsie/large(T) //Causes Nar-Sie to spawn even if the rune has been removed
|
||||
color = RUNE_COLOR_RED
|
||||
SSticker.mode.eldergod = FALSE
|
||||
new /obj/singularity/narsie/large/cult(T) //Causes Nar-Sie to spawn even if the rune has been removed
|
||||
|
||||
/obj/effect/rune/narsie/attackby(obj/I, mob/user, params) //Since the narsie rune takes a long time to make, add logging to removal.
|
||||
if((istype(I, /obj/item/weapon/tome) && iscultist(user)))
|
||||
@@ -514,11 +498,11 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
|
||||
//Rite of Resurrection: Requires the corpse of a cultist and that there have been less revives than the number of people GLOB.sacrificed
|
||||
/obj/effect/rune/raise_dead
|
||||
cultist_name = "Raise Dead"
|
||||
cultist_name = "Resurrect Cultist"
|
||||
cultist_desc = "requires the corpse of a cultist placed upon the rune. Provided there have been sufficient sacrifices, they will be revived."
|
||||
invocation = null //Depends on the name of the user - see below
|
||||
invocation = "Pasnar val'keriam usinar. Savrae ines amutan. Yam'toth remium il'tarat!" //Depends on the name of the user - see below
|
||||
icon_state = "1"
|
||||
color = "#C80000"
|
||||
color = RUNE_COLOR_MEDIUMRED
|
||||
var/static/revives_used = 0
|
||||
|
||||
/obj/effect/rune/raise_dead/examine(mob/user)
|
||||
@@ -556,9 +540,9 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
return
|
||||
rune_in_use = 1
|
||||
if(user.name == "Herbert West")
|
||||
user.say("To life, to life, I bring them!")
|
||||
invocation = "To life, to life, I bring them!"
|
||||
else
|
||||
user.say("Pasnar val'keriam usinar. Savrae ines amutan. Yam'toth remium il'tarat!")
|
||||
invocation = initial(invocation)
|
||||
..()
|
||||
revives_used++
|
||||
mob_to_revive.revive(1, 1) //This does remove disabilities and such, but the rune might actually see some use because of it!
|
||||
@@ -609,7 +593,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
invocation = "Ta'gh fara'qha fel d'amar det!"
|
||||
icon_state = "5"
|
||||
allow_excess_invokers = 1
|
||||
color = "#4D94FF"
|
||||
color = RUNE_COLOR_EMP
|
||||
|
||||
/obj/effect/rune/emp/invoke(var/list/invokers)
|
||||
var/turf/E = get_turf(src)
|
||||
@@ -639,7 +623,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
cultist_desc = "severs the link between one's spirit and body. This effect is taxing and one's physical body will take damage while this is active."
|
||||
invocation = "Fwe'sh mah erl nyag r'ya!"
|
||||
icon_state = "7"
|
||||
color = "#7D1717"
|
||||
color = RUNE_COLOR_DARKRED
|
||||
rune_in_use = 0 //One at a time, please!
|
||||
construct_invoke = 0
|
||||
var/mob/living/affecting = null
|
||||
@@ -665,9 +649,9 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
var/mob/living/user = invokers[1]
|
||||
..()
|
||||
var/turf/T = get_turf(src)
|
||||
rune_in_use = 1
|
||||
rune_in_use = TRUE
|
||||
affecting = user
|
||||
user.color = "#7D1717"
|
||||
user.add_atom_colour(RUNE_COLOR_DARKRED, ADMIN_COLOUR_PRIORITY)
|
||||
user.visible_message("<span class='warning'>[user] freezes statue-still, glowing an unearthly red.</span>", \
|
||||
"<span class='cult'>You see what lies beyond. All is revealed. While this is a wondrous experience, your physical form will waste away in this state. Hurry...</span>")
|
||||
user.ghostize(1)
|
||||
@@ -675,7 +659,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
if(!affecting)
|
||||
visible_message("<span class='warning'>[src] pulses gently before falling dark.</span>")
|
||||
affecting = null //In case it's assigned to a number or something
|
||||
rune_in_use = 0
|
||||
rune_in_use = FALSE
|
||||
return
|
||||
affecting.apply_damage(0.1, BRUTE)
|
||||
if(!(user in T))
|
||||
@@ -685,9 +669,9 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
if(user.key)
|
||||
user.visible_message("<span class='warning'>[user] slowly relaxes, the glow around [user.p_them()] dimming.</span>", \
|
||||
"<span class='danger'>You are re-united with your physical form. [src] releases its hold over you.</span>")
|
||||
user.color = initial(user.color)
|
||||
user.remove_atom_colour(ADMIN_COLOUR_PRIORITY, RUNE_COLOR_DARKRED)
|
||||
user.Weaken(3)
|
||||
rune_in_use = 0
|
||||
rune_in_use = FALSE
|
||||
affecting = null
|
||||
return
|
||||
if(user.stat == UNCONSCIOUS)
|
||||
@@ -695,14 +679,14 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
var/mob/dead/observer/G = user.get_ghost()
|
||||
to_chat(G, "<span class='cultitalic'>You feel the link between you and your body weakening... you must hurry!</span>")
|
||||
if(user.stat == DEAD)
|
||||
user.color = initial(user.color)
|
||||
rune_in_use = 0
|
||||
user.remove_atom_colour(ADMIN_COLOUR_PRIORITY, RUNE_COLOR_DARKRED)
|
||||
rune_in_use = FALSE
|
||||
affecting = null
|
||||
var/mob/dead/observer/G = user.get_ghost()
|
||||
to_chat(G, "<span class='cultitalic'><b>You suddenly feel your physical form pass on. [src]'s exertion has killed you!</b></span>")
|
||||
return
|
||||
sleep(1)
|
||||
rune_in_use = 0
|
||||
rune_in_use = FALSE
|
||||
|
||||
//Rite of the Corporeal Shield: When invoked, becomes solid and cannot be passed. Invoke again to undo.
|
||||
/obj/effect/rune/wall
|
||||
@@ -710,7 +694,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
cultist_desc = "when invoked, makes a temporary invisible wall to block passage. Can be invoked again to reverse this."
|
||||
invocation = "Khari'd! Eske'te tannin!"
|
||||
icon_state = "1"
|
||||
color = "#C80000"
|
||||
color = RUNE_COLOR_MEDIUMRED
|
||||
CanAtmosPass = ATMOS_PASS_DENSITY
|
||||
var/density_timer
|
||||
var/recharging = FALSE
|
||||
@@ -769,7 +753,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
|
||||
/obj/effect/rune/wall/proc/recharge()
|
||||
recharging = FALSE
|
||||
add_atom_colour("#C80000", FIXED_COLOUR_PRIORITY)
|
||||
add_atom_colour(RUNE_COLOR_MEDIUMRED, FIXED_COLOUR_PRIORITY)
|
||||
|
||||
/obj/effect/rune/wall/proc/update_state()
|
||||
deltimer(density_timer)
|
||||
@@ -780,10 +764,10 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
shimmer.alpha = 60
|
||||
shimmer.color = "#701414"
|
||||
add_overlay(shimmer)
|
||||
add_atom_colour("#FF0000", FIXED_COLOUR_PRIORITY)
|
||||
add_atom_colour(RUNE_COLOR_RED, FIXED_COLOUR_PRIORITY)
|
||||
else
|
||||
cut_overlays()
|
||||
add_atom_colour("#C80000", FIXED_COLOUR_PRIORITY)
|
||||
add_atom_colour(RUNE_COLOR_MEDIUMRED, FIXED_COLOUR_PRIORITY)
|
||||
|
||||
//Rite of Joined Souls: Summons a single cultist.
|
||||
/obj/effect/rune/summon
|
||||
@@ -793,7 +777,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
req_cultists = 2
|
||||
allow_excess_invokers = 1
|
||||
icon_state = "5"
|
||||
color = "#00FF00"
|
||||
color = RUNE_COLOR_SUMMON
|
||||
|
||||
/obj/effect/rune/summon/invoke(var/list/invokers)
|
||||
var/mob/living/user = invokers[1]
|
||||
@@ -838,7 +822,7 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
cultist_desc = "boils the blood of non-believers who can see the rune, rapidly dealing extreme amounts of damage. Requires 3 invokers."
|
||||
invocation = "Dedo ol'btoh!"
|
||||
icon_state = "4"
|
||||
color = "#C80000"
|
||||
color = RUNE_COLOR_MEDIUMRED
|
||||
light_color = LIGHT_COLOR_LAVA
|
||||
req_cultists = 3
|
||||
construct_invoke = 0
|
||||
@@ -905,10 +889,12 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
invocation = "Gal'h'rfikk harfrandid mud'gib!" //how the fuck do you pronounce this
|
||||
icon_state = "6"
|
||||
construct_invoke = 0
|
||||
color = "#C80000"
|
||||
color = RUNE_COLOR_MEDIUMRED
|
||||
var/ghost_limit = 5
|
||||
var/ghosts = 0
|
||||
|
||||
/obj/effect/rune/manifest/New(loc)
|
||||
..()
|
||||
/obj/effect/rune/manifest/Initialize()
|
||||
. = ..()
|
||||
notify_ghosts("Manifest rune created in [get_area(src)].", 'sound/effects/ghost2.ogg', source = src)
|
||||
|
||||
/obj/effect/rune/manifest/can_invoke(mob/living/user)
|
||||
@@ -917,6 +903,16 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
fail_invoke()
|
||||
log_game("Manifest rune failed - user not standing on rune")
|
||||
return list()
|
||||
if(user.has_status_effect(STATUS_EFFECT_SUMMONEDGHOST))
|
||||
to_chat(user, "<span class='cultitalic'>Ghosts can't summon more ghosts!</span>")
|
||||
fail_invoke()
|
||||
log_game("Manifest rune failed - user is a ghost")
|
||||
return list()
|
||||
if(ghosts >= ghost_limit)
|
||||
to_chat(user, "<span class='cultitalic'>You are sustaining too many ghosts to summon more!</span>")
|
||||
fail_invoke()
|
||||
log_game("Manifest rune failed - too many summoned ghosts")
|
||||
return list()
|
||||
var/list/ghosts_on_rune = list()
|
||||
for(var/mob/dead/observer/O in get_turf(src))
|
||||
if(O.client && !jobban_isbanned(O, ROLE_CULTIST))
|
||||
@@ -938,8 +934,13 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
var/mob/living/carbon/human/new_human = new(get_turf(src))
|
||||
new_human.real_name = ghost_to_spawn.real_name
|
||||
new_human.alpha = 150 //Makes them translucent
|
||||
new_human.equipOutfit(/datum/outfit/ghost_cultist) //give them armor
|
||||
new_human.apply_status_effect(STATUS_EFFECT_SUMMONEDGHOST) //ghosts can't summon more ghosts
|
||||
..()
|
||||
visible_message("<span class='warning'>A cloud of red mist forms above [src], and from within steps... a man.</span>")
|
||||
ghosts++
|
||||
playsound(src, 'sound/magic/exit_blood.ogg', 50, 1)
|
||||
user.apply_damage(10, BRUTE)
|
||||
visible_message("<span class='warning'>A cloud of red mist forms above [src], and from within steps... a [new_human.gender == FEMALE ? "wo":""]man.</span>")
|
||||
to_chat(user, "<span class='cultitalic'>Your blood begins flowing into [src]. You must remain in place and conscious to maintain the forms of those summoned. This will hurt you slowly but surely...</span>")
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/structure/emergency_shield/invoker/N = new(T)
|
||||
@@ -948,16 +949,17 @@ structure_check() searches for nearby cultist structures required for the invoca
|
||||
SSticker.mode.add_cultist(new_human.mind, 0)
|
||||
to_chat(new_human, "<span class='cultitalic'><b>You are a servant of the Geometer. You have been made semi-corporeal by the cult of Nar-Sie, and you are to serve them at all costs.</b></span>")
|
||||
|
||||
while(user in T)
|
||||
if(user.stat)
|
||||
while(!QDELETED(src) && !QDELETED(user) && !QDELETED(new_human) && (user in T))
|
||||
if(user.stat || new_human.InCritical())
|
||||
break
|
||||
user.apply_damage(0.1, BRUTE)
|
||||
sleep(3)
|
||||
sleep(1)
|
||||
|
||||
qdel(N)
|
||||
ghosts--
|
||||
if(new_human)
|
||||
new_human.visible_message("<span class='warning'>[new_human] suddenly dissolves into bones and ashes.</span>", \
|
||||
"<span class='cultlarge'>Your link to the world fades. Your form breaks apart.</span>")
|
||||
for(var/obj/I in new_human)
|
||||
new_human.dropItemToGround(I)
|
||||
new_human.dust()
|
||||
new_human.dropItemToGround(I, TRUE)
|
||||
new_human.dust()
|
||||
@@ -0,0 +1,124 @@
|
||||
//Supply Talisman: Has a few unique effects. Granted only to starter cultists.
|
||||
/obj/item/weapon/paper/talisman/supply
|
||||
cultist_name = "Supply Talisman"
|
||||
cultist_desc = "A multi-use talisman that can create various objects. Intended to increase the cult's strength early on."
|
||||
invocation = null
|
||||
uses = 3
|
||||
var/list/possible_summons = list(
|
||||
/datum/cult_supply/tome,
|
||||
/datum/cult_supply/metal,
|
||||
/datum/cult_supply/talisman/teleport,
|
||||
/datum/cult_supply/talisman/emp,
|
||||
/datum/cult_supply/talisman/stun,
|
||||
/datum/cult_supply/talisman/veil,
|
||||
/datum/cult_supply/soulstone,
|
||||
/datum/cult_supply/construct_shell
|
||||
)
|
||||
|
||||
/obj/item/weapon/paper/talisman/supply/invoke(mob/living/user, successfuluse = 1)
|
||||
var/list/dat = list()
|
||||
dat += "<B>There are [uses] bloody runes on the parchment.</B><BR>"
|
||||
dat += "Please choose the chant to be imbued into the fabric of reality.<BR>"
|
||||
dat += "<HR>"
|
||||
for(var/s in possible_summons)
|
||||
var/datum/cult_supply/S = s
|
||||
dat += "<a href='?src=\ref[src];id=[initial(S.id)]'>[initial(S.invocation)]</a> - [initial(S.desc)]<br>"
|
||||
var/datum/browser/popup = new(user, "talisman", "", 400, 400)
|
||||
popup.set_content(dat.Join(""))
|
||||
popup.open()
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/paper/talisman/supply/Topic(href, href_list)
|
||||
world.log << "[usr], [href], [href_list]"
|
||||
if(QDELETED(src) || usr.incapacitated() || !in_range(src, usr))
|
||||
return
|
||||
|
||||
var/id = href_list["id"]
|
||||
var/datum/cult_supply/match
|
||||
|
||||
for(var/s in possible_summons)
|
||||
var/datum/cult_supply/S = s
|
||||
if(initial(S.id) == id)
|
||||
match = S
|
||||
break
|
||||
|
||||
if(!match)
|
||||
to_chat(usr, "<span class='userdanger'>The fabric of reality quivers in agony.</span>")
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
var/summon_type = initial(match.summon_type)
|
||||
|
||||
|
||||
var/atom/movable/AM = new summon_type(T)
|
||||
if(istype(AM, /obj/item))
|
||||
usr.put_in_hands(AM)
|
||||
|
||||
uses--
|
||||
if(uses <= 0)
|
||||
to_chat(usr, "<span class='warning'>[src] crumbles to dust.</span>")
|
||||
burn()
|
||||
|
||||
/obj/item/weapon/paper/talisman/supply/weak
|
||||
cultist_name = "Lesser Supply Talisman"
|
||||
uses = 2
|
||||
|
||||
/obj/item/weapon/paper/talisman/supply/weak/Initialize(mapload)
|
||||
. = ..()
|
||||
// no runed metal from lesser talismans.
|
||||
possible_summons -= /datum/cult_supply/metal
|
||||
|
||||
/datum/cult_supply
|
||||
var/id = "used_popcorn"
|
||||
var/invocation = "Pla'ceho'lder."
|
||||
var/desc = "Summons a generic supply item, to aid the cult."
|
||||
var/summon_type = /obj/item/trash/popcorn // wait this isn't useful
|
||||
|
||||
/datum/cult_supply/tome
|
||||
id = "arcane_tome"
|
||||
invocation = "N'ath reth sh'yro eth d'raggathnor!"
|
||||
desc = "Summons an arcane tome, used to scribe runes."
|
||||
summon_type = /obj/item/weapon/tome
|
||||
|
||||
/datum/cult_supply/metal
|
||||
id = "runed_metal"
|
||||
invocation = "Bar'tea eas!"
|
||||
desc = "Provides 5 runed metal, which can build a variety of cult structures."
|
||||
summon_type = /obj/item/stack/sheet/runed_metal/five
|
||||
|
||||
/datum/cult_supply/talisman/teleport
|
||||
id = "teleport_talisman"
|
||||
invocation = "Sas'so c'arta forbici!"
|
||||
desc = "Allows you to move to a selected teleportation rune."
|
||||
summon_type = /obj/item/weapon/paper/talisman/teleport
|
||||
|
||||
/datum/cult_supply/talisman/emp
|
||||
id = "emp_talisman"
|
||||
invocation = "Ta'gh fara'qha fel d'amar det!"
|
||||
desc = "Allows you to destroy technology in a short range."
|
||||
summon_type = /obj/item/weapon/paper/talisman/emp
|
||||
|
||||
/datum/cult_supply/talisman/stun
|
||||
id = "stun_talisman"
|
||||
invocation = "Fuu ma'jin!"
|
||||
desc = "Allows you to stun a person by attacking them with the talisman. Does not work on people holding a holy weapon!"
|
||||
summon_type = /obj/item/weapon/paper/talisman/stun
|
||||
|
||||
/datum/cult_supply/talisman/veil
|
||||
id = "veil_talisman"
|
||||
invocation = "Kla'atu barada nikt'o!"
|
||||
desc = "Two use talisman, first use makes all nearby runes invisible, secnd use reveals nearby hidden runes."
|
||||
summon_type = /obj/item/weapon/paper/talisman/true_sight
|
||||
|
||||
/datum/cult_supply/soulstone
|
||||
id = "soulstone"
|
||||
invocation = "Kal'om neth!"
|
||||
desc = "Summons a soul stone, used to capture the spirits of dead or dying humans."
|
||||
summon_type = /obj/item/device/soulstone
|
||||
|
||||
/datum/cult_supply/construct_shell
|
||||
id = "construct_shell"
|
||||
invocation = "Daa'ig osk!"
|
||||
desc = "Summons a construct shell for use with soulstone-captured souls. It is too large to carry on your person."
|
||||
summon_type = /obj/structure/constructshell
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
. = successfuluse
|
||||
if(successfuluse) //if the calling whatever says we succeed, do the fancy stuff
|
||||
if(invocation)
|
||||
user.whisper(invocation)
|
||||
user.whisper(invocation, language = /datum/language/common)
|
||||
if(health_cost && iscarbon(user))
|
||||
var/mob/living/carbon/C = user
|
||||
C.apply_damage(health_cost, BRUTE, pick("l_arm", "r_arm"))
|
||||
@@ -45,79 +45,11 @@
|
||||
var/mob/living/carbon/C = user
|
||||
C.apply_damage(10, BRUTE, "head")
|
||||
|
||||
//Supply Talisman: Has a few unique effects. Granted only to starter cultists.
|
||||
/obj/item/weapon/paper/talisman/supply
|
||||
cultist_name = "Supply Talisman"
|
||||
cultist_desc = "A multi-use talisman that can create various objects. Intended to increase the cult's strength early on."
|
||||
invocation = null
|
||||
uses = 3
|
||||
|
||||
/obj/item/weapon/paper/talisman/supply/invoke(mob/living/user, successfuluse = 1)
|
||||
var/dat = "<B>There are [uses] bloody runes on the parchment.</B><BR>"
|
||||
dat += "Please choose the chant to be imbued into the fabric of reality.<BR>"
|
||||
dat += "<HR>"
|
||||
dat += "<A href='?src=\ref[src];rune=newtome'>N'ath reth sh'yro eth d'raggathnor!</A> - Summons an arcane tome, used to scribe runes and communicate with other cultists.<BR>"
|
||||
dat += "<A href='?src=\ref[src];rune=metal'>Bar'tea eas!</A> - Provides 5 runed metal.<BR>"
|
||||
dat += "<A href='?src=\ref[src];rune=teleport'>Sas'so c'arta forbici!</A> - Allows you to move to a selected teleportation rune.<BR>"
|
||||
dat += "<A href='?src=\ref[src];rune=emp'>Ta'gh fara'qha fel d'amar det!</A> - Allows you to destroy technology in a short range.<BR>"
|
||||
dat += "<A href='?src=\ref[src];rune=runestun'>Fuu ma'jin!</A> - Allows you to stun a person by attacking them with the talisman.<BR>"
|
||||
dat += "<A href='?src=\ref[src];rune=veiling'>Kla'atu barada nikt'o!</A> - Two use talisman, first use makes all nearby runes invisible, second use reveals nearby hidden runes.<BR>"
|
||||
dat += "<A href='?src=\ref[src];rune=soulstone'>Kal'om neth!</A> - Summons a soul stone, used to capure the spirits of dead or dying humans.<BR>"
|
||||
dat += "<A href='?src=\ref[src];rune=construct'>Daa'ig osk!</A> - Summons a construct shell for use with soulstone-captured souls. It is too large to carry on your person.<BR>"
|
||||
var/datum/browser/popup = new(user, "talisman", "", 400, 400)
|
||||
popup.set_content(dat)
|
||||
popup.open()
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/paper/talisman/supply/Topic(href, href_list)
|
||||
if(src)
|
||||
if(usr.stat || usr.restrained() || !in_range(src, usr))
|
||||
return
|
||||
if(href_list["rune"])
|
||||
switch(href_list["rune"])
|
||||
if("newtome")
|
||||
var/obj/item/weapon/tome/T = new(usr)
|
||||
usr.put_in_hands(T)
|
||||
if("metal")
|
||||
if(istype(src, /obj/item/weapon/paper/talisman/supply/weak))
|
||||
usr.visible_message("<span class='cultitalic'>Lesser supply talismans lack the strength to materialize runed metal!</span>")
|
||||
return
|
||||
var/obj/item/stack/sheet/runed_metal/R = new(usr,5)
|
||||
usr.put_in_hands(R)
|
||||
if("teleport")
|
||||
var/obj/item/weapon/paper/talisman/teleport/T = new(usr)
|
||||
usr.put_in_hands(T)
|
||||
if("emp")
|
||||
var/obj/item/weapon/paper/talisman/emp/T = new(usr)
|
||||
usr.put_in_hands(T)
|
||||
if("runestun")
|
||||
var/obj/item/weapon/paper/talisman/stun/T = new(usr)
|
||||
usr.put_in_hands(T)
|
||||
if("soulstone")
|
||||
var/obj/item/device/soulstone/T = new(usr)
|
||||
usr.put_in_hands(T)
|
||||
if("construct")
|
||||
new /obj/structure/constructshell(get_turf(usr))
|
||||
if("veiling")
|
||||
var/obj/item/weapon/paper/talisman/true_sight/T = new(usr)
|
||||
usr.put_in_hands(T)
|
||||
src.uses--
|
||||
if(src.uses <= 0)
|
||||
if(iscarbon(usr))
|
||||
var/mob/living/carbon/C = usr
|
||||
C.drop_item()
|
||||
visible_message("<span class='warning'>[src] crumbles to dust.</span>")
|
||||
qdel(src)
|
||||
|
||||
/obj/item/weapon/paper/talisman/supply/weak
|
||||
cultist_name = "Lesser Supply Talisman"
|
||||
uses = 2
|
||||
|
||||
//Rite of Translocation: Same as rune
|
||||
/obj/item/weapon/paper/talisman/teleport
|
||||
cultist_name = "Talisman of Teleportation"
|
||||
cultist_desc = "A single-use talisman that will teleport a user to a random rune of the same keyword."
|
||||
color = "#551A8B" // purple
|
||||
color = RUNE_COLOR_TELEPORT
|
||||
invocation = "Sas'so c'arta forbici!"
|
||||
health_cost = 5
|
||||
creation_time = 80
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
/mob/living/proc/check_devil_bane_multiplier(obj/item/weapon, mob/living/attacker)
|
||||
switch(mind.devilinfo.bane)
|
||||
var/datum/antagonist/devil/devilInfo = mind.has_antag_datum(ANTAG_DATUM_DEVIL)
|
||||
switch(devilInfo.bane)
|
||||
if(BANE_WHITECLOTHES)
|
||||
if(ishuman(attacker))
|
||||
var/mob/living/carbon/human/H = attacker
|
||||
@@ -21,13 +22,13 @@
|
||||
/obj/item/clothing/under/suit_jacket/white = 0.5,
|
||||
/obj/item/clothing/under/burial = 1
|
||||
)
|
||||
if(whiteness[U.type])
|
||||
if(U && whiteness[U.type])
|
||||
src.visible_message("<span class='warning'>[src] seems to have been harmed by the purity of [attacker]'s clothes.</span>", "<span class='notice'>Unsullied white clothing is disrupting your form.</span>")
|
||||
return whiteness[U.type] + 1
|
||||
if(BANE_TOOLBOX)
|
||||
if(istype(weapon,/obj/item/weapon/storage/toolbox))
|
||||
src.visible_message("<span class='warning'>The [weapon] seems unusually robust this time.</span>", "<span class='notice'>The [weapon] is your unmaking!</span>")
|
||||
return 2.5 // Will take four hits with a normal toolbox.
|
||||
return 2.5 // Will take four hits with a normal toolbox to crit.
|
||||
if(BANE_HARVEST)
|
||||
if(istype(weapon,/obj/item/weapon/reagent_containers/food/snacks/grown/))
|
||||
src.visible_message("<span class='warning'>The spirits of the harvest aid in the exorcism.</span>", "<span class='notice'>The harvest spirits are harming you.</span>")
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
+ <span class='notice'>Crew</span>: Resist the lure of sin and remain pure!"
|
||||
|
||||
/datum/game_mode/devil/pre_setup()
|
||||
|
||||
if(config.protect_roles_from_antagonist)
|
||||
restricted_jobs += protected_jobs
|
||||
if(config.protect_assistant_from_antagonist)
|
||||
@@ -56,10 +55,22 @@
|
||||
return 1
|
||||
|
||||
/datum/game_mode/devil/proc/post_setup_finalize(datum/mind/devil)
|
||||
set waitfor = FALSE
|
||||
sleep(rand(10,100))
|
||||
finalize_devil(devil, TRUE)
|
||||
sleep(100)
|
||||
add_devil_objectives(devil, objective_count) //This has to be in a separate loop, as we need devil names to be generated before we give objectives in devil agent.
|
||||
devil.announceDevilLaws()
|
||||
devil.announce_objectives()
|
||||
add_devil(devil.current, ascendable = TRUE) //Devil gamemode devils are ascendable.
|
||||
add_devil_objectives(devil,2)
|
||||
|
||||
/proc/is_devil(mob/living/M)
|
||||
return M && M.mind && M.mind.has_antag_datum(ANTAG_DATUM_DEVIL)
|
||||
|
||||
/proc/add_devil(mob/living/L, ascendable = FALSE)
|
||||
if(!L || !L.mind)
|
||||
return FALSE
|
||||
var/datum/antagonist/devil/devil_datum = L.mind.add_antag_datum(ANTAG_DATUM_DEVIL)
|
||||
devil_datum.ascendable = ascendable
|
||||
return devil_datum
|
||||
|
||||
/proc/remove_devil(mob/living/L)
|
||||
if(!L || !L.mind)
|
||||
return FALSE
|
||||
var/datum/antagonist/devil_datum = L.mind.has_antag_datum(ANTAG_DATUM_DEVIL)
|
||||
devil_datum.on_removal()
|
||||
return TRUE
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user