Merge branch 'master' into overhaul-event-mob-selection

This commit is contained in:
mochi
2020-07-20 07:01:11 +02:00
204 changed files with 38138 additions and 282212 deletions
+11 -1
View File
@@ -59,7 +59,17 @@
log_and_message_admins("APC Short event shorted out [affected_apc_count] APCs.")
/proc/power_restore(announce=TRUE)
power_restore_quick(announce)
if(announce)
GLOB.event_announcement.Announce("Power has been restored to [station_name()]. We apologize for the inconvenience.", "Power Systems Nominal", new_sound = 'sound/AI/poweron.ogg')
// recharge the APCs
for(var/thing in GLOB.apcs)
var/obj/machinery/power/apc/A = thing
if(!is_station_level(A.z))
continue
var/obj/item/stock_parts/cell/C = A.get_cell()
if(C)
C.give(C.maxcharge)
/proc/power_restore_quick(announce=TRUE)
if(announce)
@@ -1 +0,0 @@
//placeholder for holiday stuff
-61
View File
@@ -1,61 +0,0 @@
/proc/Christmas_Game_Start()
for(var/obj/structure/flora/tree/pine/xmas in world)
if(!is_station_level(xmas.z)) continue
for(var/turf/simulated/floor/T in orange(1,xmas))
for(var/i=1,i<=rand(1,5),i++)
new /obj/item/a_gift(T)
for(var/mob/living/simple_animal/corgi/Ian/Ian in GLOB.mob_list)
Ian.place_on_head(new /obj/item/clothing/head/helmet/space/santahat(Ian))
/proc/ChristmasEvent()
for(var/obj/structure/flora/tree/pine/xmas in world)
var/mob/living/simple_animal/hostile/tree/evil_tree = new /mob/living/simple_animal/hostile/tree(xmas.loc)
evil_tree.icon_state = xmas.icon_state
evil_tree.icon_living = evil_tree.icon_state
evil_tree.icon_dead = evil_tree.icon_state
evil_tree.icon_gib = evil_tree.icon_state
qdel(xmas)
/obj/item/toy/xmas_cracker
name = "xmas cracker"
icon = 'icons/obj/christmas.dmi'
icon_state = "cracker"
desc = "Directions for use: Requires two people, one to pull each end."
var/cracked = 0
/obj/item/toy/xmas_cracker/New()
..()
/obj/item/toy/xmas_cracker/attack(mob/target, mob/user)
if( !cracked && istype(target,/mob/living/carbon/human) && (target.stat == CONSCIOUS) && !target.get_active_hand() )
target.visible_message("<span class='notice'>[user] and [target] pop \an [src]! *pop*</span>", "<span class='notice'>You pull \an [src] with [target]! *pop*</span>", "<span class='notice'>You hear a *pop*.</span>")
var/obj/item/paper/Joke = new /obj/item/paper(user.loc)
Joke.name = "[pick("awful","terrible","unfunny")] joke"
Joke.info = pick("What did one snowman say to the other?\n\n<i>'Is it me or can you smell carrots?'</i>",
"Why couldn't the snowman get laid?\n\n<i>He was frigid!</i>",
"Where are santa's helpers educated?\n\n<i>Nowhere, they're ELF-taught.</i>",
"What happened to the man who stole advent calanders?\n\n<i>He got 25 days.</i>",
"What does Santa get when he gets stuck in a chimney?\n\n<i>Claus-trophobia.</i>",
"Where do you find chili beans?\n\n<i>The north pole.</i>",
"What do you get from eating tree decorations?\n\n<i>Tinsilitis!</i>",
"What do snowmen wear on their heads?\n\n<i>Ice caps!</i>",
"Why is Christmas just like life on ss13?\n\n<i>You do all the work and the fat guy gets all the credit.</i>",
"Why doesnt Santa have any children?\n\n<i>Because he only comes down the chimney.</i>")
new /obj/item/clothing/head/festive(target.loc)
user.update_icons()
cracked = 1
icon_state = "cracker1"
var/obj/item/toy/xmas_cracker/other_half = new /obj/item/toy/xmas_cracker(target)
other_half.cracked = 1
other_half.icon_state = "cracker2"
target.put_in_active_hand(other_half)
playsound(user, 'sound/effects/snap.ogg', 50, 1)
return 1
return ..()
/obj/item/clothing/head/festive
name = "festive paper hat"
icon_state = "xmashat"
desc = "A crappy paper hat that you are REQUIRED to wear."
flags_inv = 0
armor = list(melee = 0, bullet = 0, laser = 0,energy = 0, bomb = 0, bio = 0, rad = 0)
-1
View File
@@ -1 +0,0 @@
//placeholder for holiday stuff
-183
View File
@@ -1,183 +0,0 @@
//Uncommenting ALLOW_HOLIDAYS in config.txt will enable Holidays
GLOBAL_VAR_INIT(Holiday) // I didnt update the rest of this code because this file hasnt been ticked in years, and holiday code got overhauled
// If it really needs fixing, yell at me, -aa
//Just thinking ahead! Here's the foundations to a more robust Holiday event system.
//It's easy as hell to add stuff. Just set Holiday to something using the switch(or something else)
//then use if(Holiday == "MyHoliday") to make stuff happen on that specific day only
//Please, Don't spam stuff up with easter eggs, I'd rather somebody just delete this than people cause
//the game to lag even more in the name of one-day content.
//////////////////////////////////////////////////////////////////////////////////////////////////////////
//ALSO, MOST IMPORTANTLY: Don't add stupid stuff! Discuss bonus content with Project-Heads first please!//
//////////////////////////////////////////////////////////////////////////////////////////////////////////
// ~Carn
/hook/startup/proc/updateHoliday()
Get_Holiday()
return 1
//sets up the Holiday global variable. Shouldbe called on game configuration or something.
/proc/Get_Holiday()
if(!Holiday) return // Holiday stuff was not enabled in the config!
Holiday = null // reset our switch now so we can recycle it as our Holiday name
var/YY = text2num(time2text(world.timeofday, "YY")) // get the current year
var/MM = text2num(time2text(world.timeofday, "MM")) // get the current month
var/DD = text2num(time2text(world.timeofday, "DD")) // get the current day
//Main switch. If any of these are too dumb/inappropriate, or you have better ones, feel free to change whatever
switch(MM)
if(1) //Jan
switch(DD)
if(1) Holiday = "New Year's Day"
if(2) //Feb
switch(DD)
if(2) Holiday = "Groundhog Day"
if(14) Holiday = "Valentine's Day"
if(17) Holiday = "Random Acts of Kindness Day"
if(3) //Mar
switch(DD)
if(14) Holiday = "Pi Day"
if(17) Holiday = "St. Patrick's Day"
if(27)
if(YY == 16)
Holiday = "Easter"
if(31)
if(YY == 13)
Holiday = "Easter"
if(4) //Apr
switch(DD)
if(1)
Holiday = "April Fool's Day"
if(YY == 18 && prob(50)) Holiday = "Easter"
if(5)
if(YY == 15) Holiday = "Easter"
if(16)
if(YY == 17) Holiday = "Easter"
if(20)
Holiday = "Four-Twenty"
if(YY == 14 && prob(50)) Holiday = "Easter"
if(22) Holiday = "Earth Day"
if(5) //May
switch(DD)
if(1) Holiday = "Labour Day"
if(4) Holiday = "FireFighter's Day"
if(12) Holiday = "Owl and Pussycat Day" //what a dumb day of observence...but we -do- have costumes already :3
if(6) //Jun
if(7) //Jul
switch(DD)
if(1) Holiday = "Doctor's Day"
if(2) Holiday = "UFO Day"
if(8) Holiday = "Writer's Day"
if(30) Holiday = "Friendship Day"
if(8) //Aug
switch(DD)
if(5) Holiday = "Beer Day"
if(9) //Sep
switch(DD)
if(19) Holiday = "Talk-Like-a-Pirate Day"
if(28) Holiday = "Stupid-Questions Day"
if(10) //Oct
switch(DD)
if(4) Holiday = "Animal's Day"
if(7) Holiday = "Smiling Day"
if(16) Holiday = "Boss' Day"
if(31) Holiday = "Halloween"
if(11) //Nov
switch(DD)
if(1) Holiday = "Vegan Day"
if(13) Holiday = "Kindness Day"
if(19) Holiday = "Flowers Day"
if(21) Holiday = "Saying-'Hello' Day"
if(12) //Dec
switch(DD)
if(10) Holiday = "Human-Rights Day"
if(14) Holiday = "Monkey Day"
if(21) if(YY==12) Holiday = "End of the World"
if(22) Holiday = "Orgasming Day" //lol. These all actually exist
if(24) Holiday = "Christmas Eve"
if(25) Holiday = "Christmas"
if(26) Holiday = "Boxing Day"
if(31) Holiday = "New Year's Eve"
if(!Holiday)
//Friday the 13th
if(DD == 13)
if(time2text(world.timeofday, "DDD") == "Fri")
Holiday = "Friday the 13th"
//Allows GA and GM to set the Holiday variable
/client/proc/Set_Holiday(T as text|null)
set name = ".Set Holiday"
set category = "Event"
set desc = "Force-set the Holiday variable to make the game think it's a certain day."
if(!check_rights(R_SERVER)) return
Holiday = T
//get a new station name
station_name = null
station_name()
//update our hub status
world.update_status()
Holiday_Game_Start()
message_admins("<span class='notice'>ADMIN: Event: [key_name_admin(src)] force-set Holiday to \</span>"[Holiday]\"")
log_admin("[key_name(src)] force-set Holiday to \"[Holiday]\"")
//Run at the start of a round
/proc/Holiday_Game_Start()
if(Holiday)
to_chat(world, "<font color='blue'>and...</font>")
to_chat(world, "<h4>Happy [Holiday] Everybody!</h4>")
switch(Holiday) //special holidays
if("Easter")
//do easter stuff
if("Christmas Eve","Christmas")
Christmas_Game_Start()
return
//Nested in the random events loop. Will be triggered every 2 minutes
/proc/Holiday_Random_Event()
switch(Holiday) //special holidays
if("",null) //no Holiday today! Back to work!
return
if("Easter") //I'll make this into some helper procs at some point
/* var/list/turf/simulated/floor/Floorlist = list()
for(var/turf/simulated/floor/T)
if(T.contents)
Floorlist += T
var/turf/simulated/floor/F = Floorlist[rand(1,Floorlist.len)]
Floorlist = null
var/obj/structure/closet/C = locate(/obj/structure/closet) in F
var/obj/item/reagent_containers/food/snacks/chocolateegg/wrapped/Egg
if( C ) Egg = new(C)
else Egg = new(F)
*/
/* var/list/obj/containers = list()
for(var/obj/item/storage/S in world)
if(!is_station_level(S.z)) continue
containers += S
message_admins("<span class='notice'>DEBUG: Event: Egg spawned at [Egg.loc] ([Egg.x],[Egg.y],[Egg.z])</span>")*/
if("End of the World")
if(prob(eventchance)) GameOver()
if("Christmas","Christmas Eve")
if(prob(eventchance)) ChristmasEvent()
+1 -1
View File
@@ -38,7 +38,7 @@ GLOBAL_VAR_INIT(account_hack_attempted, 0)
if(!isnull(affected_account) && !affected_account.suspended)
message = "The hack attempt has succeeded."
var/lost = affected_account.money * (MINIMUM_PERCENTAGE_LOSS + rand(0,VARIABLE_LOSS) / 10);
var/lost = affected_account.money * (MINIMUM_PERCENTAGE_LOSS + rand(0,VARIABLE_LOSS) / 10)
affected_account.phantom_charge(lost)