[MIRROR] Fixes adjust config (#2723)
* Fixes adjust config * Update configuration.dm * Update game_options.txt * fixes persistance
This commit is contained in:
committed by
Poojawa
parent
e0b3e861c0
commit
3aafe338af
@@ -9,10 +9,13 @@
|
||||
var/times_spoken_to = 0
|
||||
var/list/shenanigans = list()
|
||||
|
||||
/obj/structure/speaking_tile/New()
|
||||
var/savefile/S = new /savefile("data/npc_saves/Poly.sav")
|
||||
S["phrases"] >> shenanigans
|
||||
..()
|
||||
/obj/structure/speaking_tile/Initialize()
|
||||
. = ..()
|
||||
var/json_file = file("data/npc_saves/Poly.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = json_decode(file2text(json_file))
|
||||
shenanigans = json["phrases"]
|
||||
|
||||
/obj/structure/speaking_tile/interact(mob/user)
|
||||
if(!isliving(user) || speaking)
|
||||
@@ -118,4 +121,4 @@
|
||||
..()
|
||||
|
||||
/obj/effect/landmark/error
|
||||
name = "error"
|
||||
name = "error"
|
||||
@@ -87,12 +87,16 @@
|
||||
/// SNPC voice handling
|
||||
|
||||
/mob/living/carbon/human/interactive/proc/loadVoice()
|
||||
var/json_file = file("data/npc_saves/snpc.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = list()
|
||||
json = json_decode(file2text(json_file))
|
||||
knownStrings = json["knownStrings"]
|
||||
if(fexists("data/npc_saves/snpc.sav"))
|
||||
var/savefile/S = new /savefile("data/npc_saves/snpc.sav")
|
||||
S["knownStrings"] >> knownStrings
|
||||
fdel(S)
|
||||
else
|
||||
var/json_file = file("data/npc_saves/snpc.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = json_decode(file2text(json_file))
|
||||
knownStrings = json["knownStrings"]
|
||||
if(isnull(knownStrings))
|
||||
knownStrings = list()
|
||||
|
||||
@@ -1618,4 +1622,4 @@
|
||||
TRAITS |= TRAIT_ROBUST
|
||||
TRAITS |= TRAIT_SMART
|
||||
faction += "bot_power"
|
||||
. = ..()
|
||||
. = ..()
|
||||
@@ -5,7 +5,7 @@
|
||||
var/ancestor_chain = 1
|
||||
var/relic_hat //Note: these two are paths
|
||||
var/relic_mask
|
||||
var/memory_saved = 0
|
||||
var/memory_saved = FALSE
|
||||
var/list/pet_monkey_names = list("Pun Pun", "Bubbles", "Mojo", "George", "Darwin", "Aldo", "Caeser", "Kanzi", "Kong", "Terk", "Grodd", "Mala", "Bojangles", "Coco", "Able", "Baker", "Scatter", "Norbit", "Travis")
|
||||
var/list/rare_pet_monkey_names = list("Professor Bobo", "Deempisi's Revenge", "Furious George", "King Louie", "Dr. Zaius", "Jimmy Rustles", "Dinner", "Lanky")
|
||||
|
||||
@@ -32,25 +32,33 @@
|
||||
equip_to_slot_or_del(new relic_mask, slot_wear_mask)
|
||||
|
||||
/mob/living/carbon/monkey/punpun/Life()
|
||||
if(SSticker.current_state == GAME_STATE_FINISHED && !memory_saved)
|
||||
Write_Memory(0)
|
||||
if(!stat && SSticker.current_state == GAME_STATE_FINISHED && !memory_saved)
|
||||
Write_Memory(FALSE, FALSE)
|
||||
memory_saved = TRUE
|
||||
..()
|
||||
|
||||
/mob/living/carbon/monkey/punpun/death(gibbed)
|
||||
if(!memory_saved || gibbed)
|
||||
Write_Memory(1,gibbed)
|
||||
if(!memory_saved)
|
||||
Write_Memory(TRUE, gibbed)
|
||||
..()
|
||||
|
||||
/mob/living/carbon/monkey/punpun/proc/Read_Memory()
|
||||
var/json_file = file("data/npc_saves/Punpun.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = list()
|
||||
json = json_decode(file2text(json_file))
|
||||
ancestor_name = json["ancestor_name"]
|
||||
ancestor_chain = json["ancestor_chain"]
|
||||
relic_hat = json["relic_hat"]
|
||||
relic_mask = json["relic_hat"]
|
||||
if(fexists("data/npc_saves/Punpun.sav")) //legacy compatability to convert old format to new
|
||||
var/savefile/S = new /savefile("data/npc_saves/Punpun.sav")
|
||||
S["ancestor_name"] >> ancestor_name
|
||||
S["ancestor_chain"] >> ancestor_chain
|
||||
S["relic_hat"] >> relic_hat
|
||||
S["relic_mask"] >> relic_mask
|
||||
fdel("data/npc_saves/Punpun.sav")
|
||||
else
|
||||
var/json_file = file("data/npc_saves/Punpun.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = json_decode(file2text(json_file))
|
||||
ancestor_name = json["ancestor_name"]
|
||||
ancestor_chain = json["ancestor_chain"]
|
||||
relic_hat = json["relic_hat"]
|
||||
relic_mask = json["relic_hat"]
|
||||
|
||||
/mob/living/carbon/monkey/punpun/proc/Write_Memory(dead, gibbed)
|
||||
var/json_file = file("data/npc_saves/Punpun.json")
|
||||
@@ -60,14 +68,10 @@
|
||||
file_data["ancestor_chain"] = null
|
||||
file_data["relic_hat"] = null
|
||||
file_data["relic_mask"] = null
|
||||
if(dead)
|
||||
file_data["ancestor_name"] = ancestor_name
|
||||
file_data["ancestor_chain"] = ancestor_chain + 1
|
||||
file_data["relic_hat"] = head ? head.type : null
|
||||
file_data["relic_mask"] = wear_mask ? wear_mask.type : null
|
||||
if(!ancestor_name)
|
||||
file_data["ancestor_name"] = name
|
||||
else
|
||||
file_data["ancestor_name"] = ancestor_name ? ancestor_name : name
|
||||
file_data["ancestor_chain"] = dead ? ancestor_chain + 1 : ancestor_chain
|
||||
file_data["relic_hat"] = head ? head.type : null
|
||||
file_data["relic_mask"] = wear_mask ? wear_mask.type : null
|
||||
fdel(json_file)
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
if(!dead)
|
||||
memory_saved = 1
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
@@ -85,7 +85,7 @@
|
||||
var/list/family = list()//var restored from savefile, has count of each child type
|
||||
var/list/children = list()//Actual mob instances of children
|
||||
var/cats_deployed = 0
|
||||
var/memory_saved = 0
|
||||
var/memory_saved = FALSE
|
||||
|
||||
/mob/living/simple_animal/pet/cat/Runtime/Initialize()
|
||||
if(prob(5))
|
||||
@@ -100,6 +100,7 @@
|
||||
Deploy_The_Cats()
|
||||
if(!stat && SSticker.current_state == GAME_STATE_FINISHED && !memory_saved)
|
||||
Write_Memory()
|
||||
memory_saved = TRUE
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/pet/cat/Runtime/make_babies()
|
||||
@@ -110,21 +111,26 @@
|
||||
|
||||
/mob/living/simple_animal/pet/cat/Runtime/death()
|
||||
if(!memory_saved)
|
||||
Write_Memory(1)
|
||||
Write_Memory(TRUE)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/pet/cat/Runtime/proc/Read_Memory()
|
||||
var/json_file = file("data/npc_saves/Runtime.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = list()
|
||||
json = json_decode(file2text(json_file))
|
||||
family = json["family"]
|
||||
if(fexists("data/npc_saves/Runtime.sav")) //legacy compatability to convert old format to new
|
||||
var/savefile/S = new /savefile("data/npc_saves/Runtime.sav")
|
||||
S["family"] >> family
|
||||
fdel("data/npc_saves/Runtime.sav")
|
||||
else
|
||||
var/json_file = file("data/npc_saves/Runtime.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = json_decode(file2text(json_file))
|
||||
family = json["family"]
|
||||
if(isnull(family))
|
||||
family = list()
|
||||
|
||||
/mob/living/simple_animal/pet/cat/Runtime/proc/Write_Memory(dead)
|
||||
var/json_file = file("data/npc_saves/Runtime.json")
|
||||
var/list/file_data = list()
|
||||
family = list()
|
||||
if(!dead)
|
||||
for(var/mob/living/simple_animal/pet/cat/kitten/C in children)
|
||||
@@ -134,9 +140,9 @@
|
||||
family[C.type] += 1
|
||||
else
|
||||
family[C.type] = 1
|
||||
file_data["family"] = family
|
||||
fdel(json_file)
|
||||
WRITE_FILE(json_file, json_encode(family))
|
||||
memory_saved = 1
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
|
||||
/mob/living/simple_animal/pet/cat/Runtime/proc/Deploy_The_Cats()
|
||||
cats_deployed = 1
|
||||
|
||||
@@ -292,7 +292,7 @@
|
||||
gold_core_spawnable = 0
|
||||
var/age = 0
|
||||
var/record_age = 1
|
||||
var/memory_saved = 0
|
||||
var/memory_saved = FALSE
|
||||
var/saved_head //path
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/Ian/Initialize()
|
||||
@@ -308,7 +308,7 @@
|
||||
P.real_name = "Ian"
|
||||
P.gender = MALE
|
||||
P.desc = "It's the HoP's beloved corgi puppy."
|
||||
Write_Memory(0)
|
||||
Write_Memory(FALSE)
|
||||
qdel(src)
|
||||
else if(age == record_age)
|
||||
icon_state = "old_corgi"
|
||||
@@ -318,24 +318,31 @@
|
||||
turns_per_move = 20
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/Ian/Life()
|
||||
if(SSticker.current_state == GAME_STATE_FINISHED && !memory_saved)
|
||||
Write_Memory(0)
|
||||
if(!stat && SSticker.current_state == GAME_STATE_FINISHED && !memory_saved)
|
||||
Write_Memory(FALSE)
|
||||
memory_saved = TRUE
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/Ian/death()
|
||||
if(!memory_saved)
|
||||
Write_Memory(1)
|
||||
Write_Memory(TRUE)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/Ian/proc/Read_Memory()
|
||||
var/json_file = file("data/npc_saves/Ian.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = list()
|
||||
json = json_decode(file2text(json_file))
|
||||
age = json["age"]
|
||||
record_age = json["record_age"]
|
||||
saved_head = json["saved_head"]
|
||||
if(fexists("data/npc_saves/Ian.sav")) //legacy compatability to convert old format to new
|
||||
var/savefile/S = new /savefile("data/npc_saves/Ian.sav")
|
||||
S["age"] >> age
|
||||
S["record_age"] >> record_age
|
||||
S["saved_head"] >> saved_head
|
||||
fdel("data/npc_saves/Ian.sav")
|
||||
else
|
||||
var/json_file = file("data/npc_saves/Ian.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = json_decode(file2text(json_file))
|
||||
age = json["age"]
|
||||
record_age = json["record_age"]
|
||||
saved_head = json["saved_head"]
|
||||
if(isnull(age))
|
||||
age = 0
|
||||
if(isnull(record_age))
|
||||
@@ -350,14 +357,18 @@
|
||||
file_data["age"] = age + 1
|
||||
if((age + 1) > record_age)
|
||||
file_data["record_age"] = record_age + 1
|
||||
else
|
||||
file_data["record_age"] = record_age
|
||||
if(inventory_head)
|
||||
file_data["saved_head"] = inventory_head.type
|
||||
else
|
||||
file_data["saved_head"] = null
|
||||
else
|
||||
file_data["age"] = 0
|
||||
file_data["record_age"] = record_age
|
||||
file_data["saved_head"] = null
|
||||
fdel(json_file)
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
memory_saved = 1
|
||||
|
||||
/mob/living/simple_animal/pet/dog/corgi/Ian/Life()
|
||||
..()
|
||||
|
||||
@@ -250,7 +250,7 @@ Difficulty: Very Hard
|
||||
use_power = NO_POWER_USE
|
||||
var/memory_saved = FALSE
|
||||
var/list/stored_items = list()
|
||||
var/static/list/blacklist = typecacheof(list(/obj/item/spellbook))
|
||||
var/list/blacklist = list()
|
||||
|
||||
/obj/machinery/smartfridge/black_box/update_icon()
|
||||
return
|
||||
@@ -276,6 +276,7 @@ Difficulty: Very Hard
|
||||
..()
|
||||
if(!memory_saved && SSticker.current_state == GAME_STATE_FINISHED)
|
||||
WriteMemory()
|
||||
memory_saved = TRUE
|
||||
|
||||
/obj/machinery/smartfridge/black_box/proc/WriteMemory()
|
||||
var/json_file = file("data/npc_saves/Blackbox.json")
|
||||
@@ -287,15 +288,18 @@ Difficulty: Very Hard
|
||||
file_data["data"] = stored_items
|
||||
fdel(json_file)
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
memory_saved = TRUE
|
||||
|
||||
/obj/machinery/smartfridge/black_box/proc/ReadMemory()
|
||||
var/json_file = file("data/npc_saves/Blackbox.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = list()
|
||||
json = json_decode(file2text(json_file))
|
||||
stored_items = json["data"]
|
||||
if(fexists("data/npc_saves/Blackbox.sav")) //legacy compatability to convert old format to new
|
||||
var/savefile/S = new /savefile("data/npc_saves/Blackbox.sav")
|
||||
S["stored_items"] >> stored_items
|
||||
fdel("data/npc_saves/Blackbox.sav")
|
||||
else
|
||||
var/json_file = file("data/npc_saves/Blackbox.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = json_decode(file2text(json_file))
|
||||
stored_items = json["data"]
|
||||
if(isnull(stored_items))
|
||||
stored_items = list()
|
||||
|
||||
@@ -789,4 +793,4 @@ Difficulty: Very Hard
|
||||
#undef ACTIVATE_WEAPON
|
||||
#undef ACTIVATE_MAGIC
|
||||
|
||||
#undef MEDAL_PREFIX
|
||||
#undef MEDAL_PREFIX
|
||||
@@ -297,7 +297,7 @@
|
||||
else
|
||||
parrot_state |= PARROT_FLEE //Otherwise, fly like a bat out of hell!
|
||||
drop_held_item(0)
|
||||
if(!stat && M.a_intent == INTENT_HELP)
|
||||
if(stat != DEAD && M.a_intent == INTENT_HELP)
|
||||
handle_automated_speech(1) //assured speak/emote
|
||||
return
|
||||
|
||||
@@ -873,7 +873,7 @@
|
||||
speak = list("Poly wanna cracker!", ":e Check the crystal, you chucklefucks!",":e Wire the solars, you lazy bums!",":e WHO TOOK THE DAMN HARDSUITS?",":e OH GOD ITS ABOUT TO DELAMINATE CALL THE SHUTTLE")
|
||||
gold_core_spawnable = 0
|
||||
speak_chance = 3
|
||||
var/memory_saved = 0
|
||||
var/memory_saved = FALSE
|
||||
var/rounds_survived = 0
|
||||
var/longest_survival = 0
|
||||
var/longest_deathstreak = 0
|
||||
@@ -904,50 +904,62 @@
|
||||
rounds_survived = max(++rounds_survived,1)
|
||||
if(rounds_survived > longest_survival)
|
||||
longest_survival = rounds_survived
|
||||
Write_Memory()
|
||||
Write_Memory(FALSE)
|
||||
memory_saved = TRUE
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/parrot/Poly/death(gibbed)
|
||||
if(!memory_saved)
|
||||
var/go_ghost = 0
|
||||
if(rounds_survived == longest_survival || rounds_survived == longest_deathstreak || prob(0.666))
|
||||
go_ghost = 1
|
||||
rounds_survived = min(--rounds_survived,0)
|
||||
if(rounds_survived < longest_deathstreak)
|
||||
longest_deathstreak = rounds_survived
|
||||
Write_Memory()
|
||||
if(go_ghost)
|
||||
var/mob/living/simple_animal/parrot/Poly/ghost/G = new(loc)
|
||||
if(mind)
|
||||
mind.transfer_to(G)
|
||||
else
|
||||
G.key = key
|
||||
Write_Memory(TRUE)
|
||||
if(rounds_survived == longest_survival || rounds_survived == longest_deathstreak || prob(0.666))
|
||||
var/mob/living/simple_animal/parrot/Poly/ghost/G = new(loc)
|
||||
if(mind)
|
||||
mind.transfer_to(G)
|
||||
else
|
||||
G.key = key
|
||||
..(gibbed)
|
||||
|
||||
/mob/living/simple_animal/parrot/Poly/proc/Read_Memory()
|
||||
var/json_file = file("data/npc_saves/Poly.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = list()
|
||||
json = json_decode(file2text(json_file))
|
||||
speech_buffer = json["phrases"]
|
||||
rounds_survived = json["roundssurvived"]
|
||||
longest_survival = json["longestsurvival"]
|
||||
longest_deathstreak = json["longestdeathstreak"]
|
||||
if(fexists("data/npc_saves/Poly.sav")) //legacy compatability to convert old format to new
|
||||
var/savefile/S = new /savefile("data/npc_saves/Poly.sav")
|
||||
S["phrases"] >> speech_buffer
|
||||
S["roundssurvived"] >> rounds_survived
|
||||
S["longestsurvival"] >> longest_survival
|
||||
S["longestdeathstreak"] >> longest_deathstreak
|
||||
fdel("data/npc_saves/Poly.sav")
|
||||
else
|
||||
var/json_file = file("data/npc_saves/Poly.json")
|
||||
if(!fexists(json_file))
|
||||
return
|
||||
var/list/json = json_decode(file2text(json_file))
|
||||
speech_buffer = json["phrases"]
|
||||
rounds_survived = json["roundssurvived"]
|
||||
longest_survival = json["longestsurvival"]
|
||||
longest_deathstreak = json["longestdeathstreak"]
|
||||
if(!islist(speech_buffer))
|
||||
speech_buffer = list()
|
||||
|
||||
/mob/living/simple_animal/parrot/Poly/proc/Write_Memory()
|
||||
/mob/living/simple_animal/parrot/Poly/proc/Write_Memory(dead)
|
||||
var/json_file = file("data/npc_saves/Poly.json")
|
||||
var/list/file_data = list()
|
||||
if(islist(speech_buffer))
|
||||
file_data["phrases"] = speech_buffer
|
||||
file_data["roundssurvived"] = rounds_survived
|
||||
file_data["longestsurvival"] = longest_survival
|
||||
file_data["longestdeathstreak"] = longest_deathstreak
|
||||
if(dead)
|
||||
file_data["roundssurvived"] = min(rounds_survived - 1, 0)
|
||||
file_data["longestsurvival"] = longest_survival
|
||||
if(rounds_survived - 1 < longest_deathstreak)
|
||||
file_data["longestdeathstreak"] = rounds_survived - 1
|
||||
else
|
||||
file_data["longestdeathstreak"] = longest_deathstreak
|
||||
else
|
||||
file_data["roundssurvived"] = rounds_survived + 1
|
||||
if(rounds_survived + 1 > longest_survival)
|
||||
file_data["longestsurvival"] = rounds_survived + 1
|
||||
else
|
||||
file_data["longestsurvival"] = longest_survival
|
||||
file_data["longestdeathstreak"] = longest_deathstreak
|
||||
fdel(json_file)
|
||||
WRITE_FILE(json_file, json_encode(file_data))
|
||||
memory_saved = 1
|
||||
|
||||
/mob/living/simple_animal/parrot/Poly/ghost
|
||||
name = "The Ghost of Poly"
|
||||
@@ -959,7 +971,7 @@
|
||||
butcher_results = list(/obj/item/ectoplasm = 1)
|
||||
|
||||
/mob/living/simple_animal/parrot/Poly/ghost/Initialize()
|
||||
memory_saved = 1 //At this point nothing is saved
|
||||
memory_saved = TRUE //At this point nothing is saved
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/parrot/Poly/ghost/handle_automated_speech()
|
||||
@@ -984,4 +996,4 @@
|
||||
loc = H
|
||||
H.ContractDisease(P)
|
||||
parrot_interest = null
|
||||
H.visible_message("<span class='danger'>[src] dive bombs into [H]'s chest and vanishes!</span>", "<span class='userdanger'>[src] dive bombs into your chest, vanishing! This can't be good!</span>")
|
||||
H.visible_message("<span class='danger'>[src] dive bombs into [H]'s chest and vanishes!</span>", "<span class='userdanger'>[src] dive bombs into your chest, vanishing! This can't be good!</span>")
|
||||
Reference in New Issue
Block a user