mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-11 23:23:28 +01:00
TG: Rewrote the cinematic system to be centralised and controlled by the gameticker,
rather than handled per mob with like, 3 loops and a seperate process for each mob.dmPlease report any bugs/derps to me asap. I've tested it as much as I can locally, but because it relates to events that require a large number of players it's very hard to test. TODO: I was intending to use dust to kill players off on a nuclear-loss. However dust() is very very broken. So I've hardcoded everything to die until I can fix dust(). Added an adminverb for 'Game Master's. It was a debug verb so I could test cinematics but I've left it in as it might be handy for events, especially if we get more cinematics. To access it type "cinematic" in full into the input bar as a Game Master, then follow the prompts. At the moment, it only handles nuclear stuff (that's all there is anyway). You can choose where the nuke detonated 0= on station; 1= near station but in space; 2= off the z-level. You can also force a cinematic from another game-mode to play with the prompt after that one. Note: All mobs are buckled to a bed located inside the gameticker (odd I know) whilst a cinematic is playing. The bed is deleted afterwards releasing all players. If off_station=0 then all mobs will be killed too. This is to stop people running around and doing stuff during the cinematic. I really didn't want to add more variables/checks to mobs. Revision: r3481 Author: elly1...@rocketmail.com
This commit is contained in:
@@ -795,6 +795,7 @@
|
||||
#include "code\modules\admin\verbs\adminsay.dm"
|
||||
#include "code\modules\admin\verbs\atmosdebug.dm"
|
||||
#include "code\modules\admin\verbs\BrokenInhands.dm"
|
||||
#include "code\modules\admin\verbs\cinematic.dm"
|
||||
#include "code\modules\admin\verbs\custom_event.dm"
|
||||
#include "code\modules\admin\verbs\deadsay.dm"
|
||||
#include "code\modules\admin\verbs\debug.dm"
|
||||
|
||||
+1
-3
@@ -383,7 +383,6 @@
|
||||
opacity = 0
|
||||
density = 0
|
||||
|
||||
|
||||
/obj/hud
|
||||
name = "hud"
|
||||
unacidable = 1
|
||||
@@ -400,9 +399,8 @@
|
||||
var/obj/screen/g_dither = null
|
||||
var/obj/screen/blurry = null
|
||||
var/list/darkMask = null
|
||||
var/obj/screen/station_explosion = null
|
||||
|
||||
var/h_type = /obj/screen
|
||||
var/h_type = /obj/screen //this is like...the most pointless thing ever. Use a god damn define!
|
||||
|
||||
/obj/item
|
||||
name = "item"
|
||||
|
||||
@@ -179,13 +179,11 @@
|
||||
world << "\blue<b>[i]..</b>"
|
||||
sleep(10)
|
||||
enter_allowed = 0
|
||||
for(var/mob/M in world)
|
||||
if(M.client)
|
||||
spawn(0)
|
||||
M.client.station_explosion_cinematic()
|
||||
sleep(110)
|
||||
ticker.mode:station_was_nuked = 1
|
||||
ticker.mode:explosion_in_progress = 0
|
||||
if(ticker)
|
||||
ticker.station_explosion_cinematic(0,null)
|
||||
if(ticker.mode)
|
||||
ticker.mode:station_was_nuked = 1
|
||||
ticker.mode:explosion_in_progress = 0
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -138,6 +138,107 @@ var/datum/roundinfo/roundinfo = new()
|
||||
return 1
|
||||
|
||||
/datum/controller/gameticker
|
||||
//station_explosion used to be a variable for every mob's hud. Which was a waste!
|
||||
//Now we have a general cinematic centrally held within the gameticker....far more efficient!
|
||||
var/obj/screen/cinematic = null
|
||||
|
||||
//Plus it provides an easy way to make cinematics for other events. Just use this as a template :)
|
||||
proc/station_explosion_cinematic(var/station_missed=0, var/override = null)
|
||||
if( cinematic ) return //already a cinematic in progress!
|
||||
|
||||
//initialise our cinematic screen object
|
||||
cinematic = new(src)
|
||||
cinematic.icon = 'station_explosion.dmi'
|
||||
cinematic.icon_state = "start"
|
||||
cinematic.layer = 20
|
||||
cinematic.mouse_opacity = 0
|
||||
cinematic.screen_loc = "1,3" //TODO resize them
|
||||
|
||||
var/obj/structure/stool/bed/temp_buckle = new(src)
|
||||
//Incredibly hackish. It creates a bed within the gameticker (lol) to stop mobs running around
|
||||
if(station_missed)
|
||||
for(var/mob/M in world)
|
||||
M.buckled = temp_buckle //buckles the mob so it can't do anything
|
||||
if(M.client)
|
||||
M.client.screen += cinematic //show every client the cinematic
|
||||
else //nuke kills everyone on z-level 1 to prevent "hurr-durr I survived"
|
||||
for(var/mob/M in world)
|
||||
M.buckled = temp_buckle
|
||||
if(M.client)
|
||||
M.client.screen += cinematic
|
||||
switch(M.z)
|
||||
if(0) //inside a crate or something
|
||||
var/turf/T = get_turf(M)
|
||||
if(T && T.z==1) //we don't use M.death(0) because it calls a for(/mob) loop and
|
||||
M.health = 0
|
||||
M.stat = DEAD
|
||||
if(1) //on a z-level 1 turf.
|
||||
M.health = 0
|
||||
M.stat = DEAD
|
||||
|
||||
//Now animate the cinematic
|
||||
switch(station_missed)
|
||||
if(2) //nuke was nowhere nearby //TODO: a really distant explosion animation
|
||||
sleep(50)
|
||||
world << sound('explosionfar.ogg')
|
||||
|
||||
if(1) //nuke was nearby but (mostly) missed
|
||||
if( mode && !override )
|
||||
override = mode.name
|
||||
switch( override )
|
||||
if("nuclear emergency")
|
||||
flick("start_nuke",cinematic)
|
||||
sleep(50)
|
||||
world << sound('explosionfar.ogg')
|
||||
flick("explode2",cinematic)
|
||||
cinematic.icon_state = "loss_nuke2"
|
||||
else
|
||||
sleep(50)
|
||||
world << sound('explosionfar.ogg')
|
||||
flick("explode2",cinematic)
|
||||
|
||||
else //station was destroyed
|
||||
if( mode && !override )
|
||||
override = mode.name
|
||||
switch( override )
|
||||
if("nuclear emergency")
|
||||
flick("start_nuke",cinematic)
|
||||
sleep(50)
|
||||
world << sound('explosionfar.ogg')
|
||||
cinematic.icon_state = "end"
|
||||
flick("explode",cinematic)
|
||||
cinematic.icon_state = "loss_nuke"
|
||||
|
||||
if("AI malfunction")
|
||||
flick("start_malf",cinematic)
|
||||
sleep(50)
|
||||
world << sound('explosionfar.ogg')
|
||||
cinematic.icon_state = "end"
|
||||
flick("explode",cinematic)
|
||||
cinematic.icon_state = "loss_malf"
|
||||
|
||||
if("blob")
|
||||
flick("start_blob",cinematic) //TODO: make a blob one
|
||||
sleep(50)
|
||||
world << sound('explosionfar.ogg')
|
||||
cinematic.icon_state = "end"
|
||||
flick("explode",cinematic)
|
||||
cinematic.icon_state = "loss_blob" //TODO: make a blob one
|
||||
|
||||
else
|
||||
//default station-destroyed ending
|
||||
sleep(50)
|
||||
world << sound('explosionfar.ogg')
|
||||
cinematic.icon_state = "end"
|
||||
flick("explode",cinematic)
|
||||
cinematic.icon_state = "loss_general"
|
||||
sleep(100)
|
||||
|
||||
//Tidy-up time!
|
||||
if(cinematic) del(cinematic) //end the cinematic
|
||||
if(temp_buckle) del(temp_buckle) //release everybody
|
||||
return
|
||||
|
||||
|
||||
proc/create_characters()
|
||||
for(var/mob/new_player/player in world)
|
||||
|
||||
@@ -188,14 +188,11 @@
|
||||
world << i
|
||||
sleep(10)
|
||||
enter_allowed = 0
|
||||
for(var/mob/M in world)
|
||||
if(M.client)
|
||||
spawn(0)
|
||||
M.client.station_explosion_cinematic()
|
||||
sleep(110)
|
||||
ticker.mode:station_was_nuked = 1
|
||||
ticker.mode:explosion_in_progress = 0
|
||||
//world << "<B>Everyone was killed by the self-destruct!"
|
||||
if(ticker)
|
||||
ticker.station_explosion_cinematic(0,null)
|
||||
if(ticker.mode)
|
||||
ticker.mode:station_was_nuked = 1
|
||||
ticker.mode:explosion_in_progress = 0
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -159,6 +159,7 @@
|
||||
return
|
||||
|
||||
|
||||
#define NUKERANGE 80
|
||||
/obj/machinery/nuclearbomb/proc/explode()
|
||||
if (src.safety)
|
||||
src.timing = 0
|
||||
@@ -176,47 +177,40 @@
|
||||
enter_allowed = 0
|
||||
|
||||
var/off_station = 0
|
||||
var/area/A = get_area(src.loc)
|
||||
if(A && (istype(A,/area/syndicate_station) || A.type == "/area"))
|
||||
off_station = 1
|
||||
if (ticker && ticker.mode && ticker.mode.name == "nuclear emergency")
|
||||
ticker.mode:herp = syndicate_station_at_station
|
||||
ticker.mode:nuke_off_station = off_station
|
||||
var/turf/bomb_location = get_turf(src)
|
||||
if( bomb_location && (bomb_location.z == 1) )
|
||||
if( (bomb_location.x < (128-NUKERANGE)) || (bomb_location.x > (128+NUKERANGE)) || (bomb_location.y < (128-NUKERANGE)) || (bomb_location.y > (128+NUKERANGE)) )
|
||||
off_station = 1
|
||||
else
|
||||
off_station = 2
|
||||
|
||||
for(var/mob/M in world)
|
||||
if(M.client)
|
||||
spawn(0)
|
||||
M.client.station_explosion_cinematic(off_station)
|
||||
sleep(110)
|
||||
if (ticker)
|
||||
if(ticker.mode && ticker.mode.name == "nuclear emergency")
|
||||
ticker.mode:herp = syndicate_station_at_station
|
||||
ticker.mode:nuke_off_station = off_station
|
||||
ticker.station_explosion_cinematic(off_station,null)
|
||||
if(ticker.mode)
|
||||
ticker.mode.explosion_in_progress = 0
|
||||
if(ticker.mode.name == "nuclear emergency")
|
||||
ticker.mode:nukes_left --
|
||||
else
|
||||
world << "<B>The station was destoyed by the nuclear blast!</B>"
|
||||
|
||||
if (ticker && ticker.mode)
|
||||
ticker.mode.explosion_in_progress = 0
|
||||
if(ticker.mode.name == "nuclear emergency")
|
||||
ticker.mode:nukes_left --
|
||||
ticker.mode.station_was_nuked = (off_station==0)
|
||||
ticker.mode.station_was_nuked = (off_station<2) //offstation==1 is a draw. the station becomes irradiated and needs to be evacuated.
|
||||
//kinda shit but I couldn't get permission to do what I wanted to do.
|
||||
|
||||
else
|
||||
world << "<B>The station was destoyed by the nuclear blast!</B>"
|
||||
ticker.mode.station_was_nuked = 1
|
||||
/*
|
||||
TODO: derped blast should partially damage nearest objects
|
||||
and do not reboot the game. Also make it work properly on other z-levels --rastaf0
|
||||
Further TODO: make nuke detonation work with objectives. Right now, you can't track player
|
||||
location because they are viewing the cinematic (can't get_turf on them to determine z_level
|
||||
as it will return null). Leaving this for you since you apparently plan to work this further. /N
|
||||
*/
|
||||
if(!ticker.mode.check_finished())//If the mode does not deal with the nuke going off so just reboot because everyone is stuck as is
|
||||
world << "<B>Resetting in 30 seconds!</B>"
|
||||
|
||||
if(!ticker.mode.check_finished())//If the mode does not deal with the nuke going off so just reboot because everyone is stuck as is
|
||||
world << "<B>Resetting in 30 seconds!</B>"
|
||||
|
||||
//feedback_set_details("end_error","nuke - unhandled ending")
|
||||
if(blackbox)
|
||||
blackbox.save_all_data_to_sql()
|
||||
sleep(300)
|
||||
log_game("Rebooting due to nuclear detonation")
|
||||
world.Reboot()
|
||||
return
|
||||
feedback_set_details("end_error","nuke - unhandled ending")
|
||||
|
||||
if(blackbox)
|
||||
blackbox.save_all_data_to_sql()
|
||||
sleep(300)
|
||||
log_game("Rebooting due to nuclear detonation")
|
||||
world.Reboot()
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/disk/nuclear/Del()
|
||||
if(blobstart.len > 0)
|
||||
|
||||
@@ -289,7 +289,8 @@
|
||||
verbs += /client/proc/everyone_random
|
||||
verbs += /client/proc/only_one
|
||||
verbs += /client/proc/deadmin_self
|
||||
verbs += /client/proc/getruntimelog //used by coders to retrieve runtime logs
|
||||
// verbs += /client/proc/giveruntimelog //used by coders to retrieve runtime logs
|
||||
verbs += /client/proc/cinematic //used by coders to retrieve runtime logs
|
||||
verbs += /client/proc/enable_debug_verbs
|
||||
verbs += /client/proc/kill_air
|
||||
verbs += /client/proc/callprocgen
|
||||
@@ -418,6 +419,9 @@
|
||||
verbs -= /client/proc/deadmin_self
|
||||
verbs -= /client/proc/jumptocoord
|
||||
verbs -= /client/proc/everyone_random
|
||||
// verbs -= /client/proc/giveruntimelog //used by coders to retrieve runtime logs
|
||||
// verbs -= /client/proc/getserverlog
|
||||
verbs -= /client/proc/cinematic
|
||||
verbs -= /client/proc/cmd_admin_change_custom_event
|
||||
verbs -= /client/proc/admin_invis
|
||||
verbs -= /client/proc/callprocgen
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/client/proc/cinematic(var/cinematic as anything in list("explosion",null))
|
||||
set name = "cinematic"
|
||||
set category = "Fun"
|
||||
set desc = "Shows a cinematic." // Intended for testing but I thought it might be nice for events on the rare occasion Feel free to comment it out if it's not wanted.
|
||||
set hidden = 1
|
||||
if(!ticker) return
|
||||
switch(cinematic)
|
||||
if("explosion")
|
||||
var/parameter = input(src,"station_missed = ?","Enter Parameter",0) as num
|
||||
var/override
|
||||
switch(parameter)
|
||||
if(1)
|
||||
override = input(src,"mode = ?","Enter Parameter",null) as anything in list("nuclear emergency","no override")
|
||||
if(0)
|
||||
override = input(src,"mode = ?","Enter Parameter",null) as anything in list("blob","nuclear emergency","AI malfunction","no override")
|
||||
ticker.station_explosion_cinematic(parameter,override)
|
||||
return
|
||||
@@ -1,8 +1,3 @@
|
||||
|
||||
/obj/hud/proc/ghost_hud()
|
||||
station_explosion = new h_type( src )
|
||||
station_explosion.icon = 'station_explosion.dmi'
|
||||
station_explosion.icon_state = "start"
|
||||
station_explosion.layer = 20
|
||||
station_explosion.mouse_opacity = 0
|
||||
station_explosion.screen_loc = "1,3"
|
||||
return
|
||||
@@ -37,14 +37,6 @@
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
// station explosion cinematic
|
||||
src.station_explosion = new src.h_type( src )
|
||||
src.station_explosion.icon = 'station_explosion.dmi'
|
||||
src.station_explosion.icon_state = "start"
|
||||
src.station_explosion.layer = 20
|
||||
src.station_explosion.mouse_opacity = 0
|
||||
src.station_explosion.screen_loc = "1,3"
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
using = new src.h_type( src )
|
||||
|
||||
@@ -39,14 +39,6 @@
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
// station explosion cinematic
|
||||
src.station_explosion = new src.h_type( src )
|
||||
src.station_explosion.icon = 'station_explosion.dmi'
|
||||
src.station_explosion.icon_state = "start"
|
||||
src.station_explosion.layer = 20
|
||||
src.station_explosion.mouse_opacity = 0
|
||||
src.station_explosion.screen_loc = "1,3"
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
using = new src.h_type( src )
|
||||
|
||||
@@ -1,10 +1,4 @@
|
||||
/obj/hud/proc/brain_hud(var/ui_style='screen1_old.dmi')
|
||||
station_explosion = new h_type( src )
|
||||
station_explosion.icon = 'station_explosion.dmi'
|
||||
station_explosion.icon_state = "start"
|
||||
station_explosion.layer = 20
|
||||
station_explosion.mouse_opacity = 0
|
||||
station_explosion.screen_loc = "1,3"
|
||||
|
||||
blurry = new h_type( src )
|
||||
blurry.screen_loc = "WEST,SOUTH to EAST,NORTH"
|
||||
|
||||
@@ -41,14 +41,6 @@
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
// station explosion cinematic
|
||||
src.station_explosion = new src.h_type( src )
|
||||
src.station_explosion.icon = 'station_explosion.dmi'
|
||||
src.station_explosion.icon_state = "start"
|
||||
src.station_explosion.layer = 20
|
||||
src.station_explosion.mouse_opacity = 0
|
||||
src.station_explosion.screen_loc = "1,3"
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
using = new src.h_type( src )
|
||||
|
||||
@@ -44,12 +44,4 @@
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
// station explosion cinematic
|
||||
src.station_explosion = new src.h_type( src )
|
||||
src.station_explosion.icon = 'station_explosion.dmi'
|
||||
src.station_explosion.icon_state = "start"
|
||||
src.station_explosion.layer = 20
|
||||
src.station_explosion.mouse_opacity = 0
|
||||
src.station_explosion.screen_loc = "1,3"
|
||||
|
||||
*/
|
||||
@@ -43,14 +43,6 @@
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
// station explosion cinematic
|
||||
src.station_explosion = new src.h_type( src )
|
||||
src.station_explosion.icon = 'station_explosion.dmi'
|
||||
src.station_explosion.icon_state = "start"
|
||||
src.station_explosion.layer = 20
|
||||
src.station_explosion.mouse_opacity = 0
|
||||
src.station_explosion.screen_loc = "1,3"
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
using = new src.h_type( src )
|
||||
|
||||
@@ -1,10 +1,2 @@
|
||||
/obj/hud/proc/ai_hud()
|
||||
|
||||
src.station_explosion = new src.h_type( src )
|
||||
src.station_explosion.icon = 'station_explosion.dmi'
|
||||
src.station_explosion.icon_state = "start"
|
||||
src.station_explosion.layer = 20
|
||||
src.station_explosion.mouse_opacity = 0
|
||||
src.station_explosion.screen_loc = "1,3"
|
||||
|
||||
return
|
||||
@@ -38,14 +38,6 @@
|
||||
src.druggy.layer = 17
|
||||
src.druggy.mouse_opacity = 0
|
||||
|
||||
// station explosion cinematic
|
||||
src.station_explosion = new src.h_type( src )
|
||||
src.station_explosion.icon = 'station_explosion.dmi'
|
||||
src.station_explosion.icon_state = "start"
|
||||
src.station_explosion.layer = 20
|
||||
src.station_explosion.mouse_opacity = 0
|
||||
src.station_explosion.screen_loc = "1,3"
|
||||
|
||||
var/obj/screen/using
|
||||
|
||||
|
||||
|
||||
@@ -1038,44 +1038,6 @@ note dizziness decrements automatically in the mob's Life() proc.
|
||||
statpanel("Spells","[S.holder_var_type] [S.holder_var_amount]",S)
|
||||
|
||||
|
||||
/client/proc/station_explosion_cinematic(var/station_missed)
|
||||
if(!mob || !ticker) return
|
||||
if(!mob.client || !mob.hud_used || !ticker.mode) return
|
||||
// M.loc = null this might make it act weird but fuck putting them in nullspace, it causes issues.
|
||||
var/obj/screen/boom = mob.hud_used.station_explosion
|
||||
if(!istype(boom)) return
|
||||
|
||||
mob.client.screen += boom
|
||||
|
||||
switch(ticker.mode.name)
|
||||
if("nuclear emergency")
|
||||
flick("start_nuke", boom)
|
||||
if("AI malfunction")
|
||||
flick("start_malf", boom)
|
||||
else
|
||||
boom.icon_state = "start"
|
||||
|
||||
sleep(40)
|
||||
if(boom && mob)
|
||||
mob << sound('explosionfar.ogg')
|
||||
boom.icon_state = "end"
|
||||
if(!station_missed) flick("explode", boom)
|
||||
else flick("explode2", boom)
|
||||
sleep(40)
|
||||
|
||||
if(boom)
|
||||
switch(ticker.mode.name)
|
||||
if("nuclear emergency")
|
||||
if(!station_missed) boom.icon_state = "loss_nuke"
|
||||
else boom.icon_state = "loss_nuke2"
|
||||
if("malfunction")
|
||||
boom.icon_state = "loss_malf"
|
||||
if("blob")
|
||||
return//Nothin here yet and the general one does not fit.
|
||||
else
|
||||
boom.icon_state = "loss_general"
|
||||
return
|
||||
|
||||
|
||||
// facing verbs
|
||||
/mob/proc/canface()
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
|
||||
/obj/hud/proc/unplayer_hud()
|
||||
src.station_explosion = new src.h_type( src )
|
||||
src.station_explosion.icon = 'station_explosion.dmi'
|
||||
src.station_explosion.icon_state = "start"
|
||||
src.station_explosion.layer = 20
|
||||
src.station_explosion.mouse_opacity = 0
|
||||
src.station_explosion.screen_loc = "1,3"
|
||||
return
|
||||
Reference in New Issue
Block a user