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.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3481 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
elly1989@rocketmail.com
2012-04-19 20:33:19 +00:00
parent af3798e8d7
commit 575654babb
19 changed files with 149 additions and 183 deletions
+1 -3
View File
@@ -246,7 +246,6 @@
opacity = 0
density = 0
/obj/hud
name = "hud"
unacidable = 1
@@ -263,9 +262,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"
+91
View File
@@ -128,6 +128,97 @@ var/global/datum/controller/gameticker/ticker
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
//...creates a bed within the gameticker (lol)
//to stop mobs running around
for(var/mob/M)
if(M.client)
M.client.screen += cinematic //show every client the cinematic
M.buckled = temp_buckle //buckle everybody to our pseudo-bed
if(!station_missed)
M.stat = DEAD
//TODO: impliment dust() instead of this (gotta fix it first, dust() is buggy as hell)
//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)
if(temp_buckle) del(temp_buckle) //release everybody
return
proc/create_characters()
for(var/mob/new_player/player in world)
@@ -181,14 +181,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
+30 -51
View File
@@ -141,7 +141,6 @@
/obj/machinery/nuclearbomb/ex_act(severity)
return
/obj/machinery/nuclearbomb/blob_act()
if (src.timing == -1.0)
return
@@ -150,6 +149,7 @@
return
#define NUKERANGE 80
/obj/machinery/nuclearbomb/proc/explode()
if (src.safety)
src.timing = 0
@@ -163,66 +163,45 @@
ticker.mode.explosion_in_progress = 1
sleep(100)
/*
var/turf/ground_zero = get_turf(loc)
explosion(ground_zero, 50, 250, 500, 750)
*/
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>"
for(var/mob/M in world)
if(M.z==1)
spawn(0)
M.gib()
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.
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)
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>"
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>"
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 (ticker.mode && ticker.mode.name == "nuclear emergency")
if(blobstart.len > 0)
var/obj/D = new /obj/item/weapon/disk/nuclear(pick(blobstart))
message_admins("[src] has been destroyed. Spawning [D] at ([D.x], [D.y], [D.z]).")
+2
View File
@@ -272,6 +272,7 @@
verbs += /client/proc/only_one
verbs += /client/proc/deadmin_self
verbs += /client/proc/getruntimelog //used by coders to retrieve runtime logs
verbs += /client/proc/cinematic //show a cinematic sequence
else return
return
@@ -397,6 +398,7 @@
verbs -= /client/proc/everyone_random
verbs -= /client/proc/Set_Holiday
verbs -= /client/proc/getruntimelog //used by coders to retrieve runtime logs
verbs += /client/proc/cinematic //show a cinematic sequence
verbs -= /proc/possess
verbs -= /proc/release
//verbs -= /client/proc/give_spell --Merged with view variables
+1 -1
View File
@@ -868,7 +868,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
command_alert("For budget reasons, Centcomm is no longer beaming gravitons to your station. We appoligize for any inconvience.")
feedback_add_details("admin_verb","TSGOFF") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
//CARN
/client/proc/toggle_random_events()
set category = "Server"
set name = "Toggle random events on/off"
+1 -6
View File
@@ -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
-38
View File
@@ -942,44 +942,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 -6
View File
@@ -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
+16 -8
View File
@@ -93,6 +93,14 @@ Stuff which is in development and not yet visible to players or just code relate
should be listed in the changelog upon commit tho. Thanks. -->
<!-- To take advantage of the pretty new format (well it was new when I wrote this anyway), open the "add-to-changelog.html" file in any browser and add the stuff and then generate the html code and paste it here -->
<div class="commit sansserif">
<h2 class="date">19 April 2012</h2>
<h3 class="author">Carn updated:</h3>
<ul class="changes bgimages16">
<li class="bugfix">Rewrote the cinematic system to try and simplify and optimise it. Please report any bugs asap to me or coderbus, thanks.</li>
</ul>
</div>
<div class="commit sansserif">
<h2 class="date">Tuesday, April 17th</h2>
<h3 class="author">Kor updated:</h3>
@@ -137,10 +145,10 @@ should be listed in the changelog upon commit tho. Thanks. -->
<li class="wip">CONTRABAND-CON UPDATE: Added posters. I'm sorry to add it seperately with the rest of contraband, but there was a lack of sprites for everything else. Hopefully, people will gain interest and get me some damn sprites this way :3
As I said, this is an ongoing project of mine. So starting of, we've got...</li>
<li class="rscadd">POSTERS! Posters come in rolled packages that can adhere to any wall or r_wall, if it's uncluttered enough.
<BR><BR>How they get on-board: The quartermaster can now set the receiver frequency of his supplycomp circuit board. A bit simplistic as of now, will work on it later. Building a supplycomp with a properly set up circuitboard will give access to the Contraband crate.
<BR><BR>How they're used: Unfold the rolled poster on any wall or r_wall to create the poster. There are currently 17 designs, with the possibility of me adding more.
<BR><BR>How to get rid of them: You can rip them using your hand... To cleanly extract them and not ruin them for future use, however, you can use a pair of wirecutters.
<BR><BR>How they're classified: They're contraband, so it's perfectly okay for security officers to confiscate them. Punishment for contraband-providers (or end-users, if you want to go full nazi) is up to the situational commanding officers.
<BR><BR>How they get on-board: The quartermaster can now set the receiver frequency of his supplycomp circuit board. A bit simplistic as of now, will work on it later. Building a supplycomp with a properly set up circuitboard will give access to the Contraband crate.
<BR><BR>How they're used: Unfold the rolled poster on any wall or r_wall to create the poster. There are currently 17 designs, with the possibility of me adding more.
<BR><BR>How to get rid of them: You can rip them using your hand... To cleanly extract them and not ruin them for future use, however, you can use a pair of wirecutters.
<BR><BR>How they're classified: They're contraband, so it's perfectly okay for security officers to confiscate them. Punishment for contraband-providers (or end-users, if you want to go full nazi) is up to the situational commanding officers.
</ul>
<h3 class="author">Nodrak updated:</h3>
@@ -179,10 +187,10 @@ should be listed in the changelog upon commit tho. Thanks. -->
<li class="wip">CONTRABAND-CON UPDATE: Added posters. I'm sorry to add it seperately with the rest of contraband, but there was a lack of sprites for everything else. Hopefully, people will gain interest and get me some damn sprites this way :3
As I said, this is an ongoing project of mine. So starting of, we've got...</li>
<li class="rscadd">POSTERS! Posters come in rolled packages that can adhere to any wall or r_wall, if it's uncluttered enough.
<BR><BR>How they get on-board: The quartermaster can now set the receiver frequency of his supplycomp circuit board. A bit simplistic as of now, will work on it later. Building a supplycomp with a properly set up circuitboard will give access to the Contraband crate.
<BR><BR>How they're used: Unfold the rolled poster on any wall or r_wall to create the poster. There are currently 17 designs, with the possibility of me adding more.
<BR><BR>How to get rid of them: You can rip them using your hand... To cleanly extract them and not ruin them for future use, however, you can use a pair of wirecutters.
<BR><BR>How they're classified: They're contraband, so it's perfectly okay for security officers to confiscate them. Punishment for contraband-providers (or end-users, if you want to go full nazi) is up to the situational commanding officers.
<BR><BR>How they get on-board: The quartermaster can now set the receiver frequency of his supplycomp circuit board. A bit simplistic as of now, will work on it later. Building a supplycomp with a properly set up circuitboard will give access to the Contraband crate.
<BR><BR>How they're used: Unfold the rolled poster on any wall or r_wall to create the poster. There are currently 17 designs, with the possibility of me adding more.
<BR><BR>How to get rid of them: You can rip them using your hand... To cleanly extract them and not ruin them for future use, however, you can use a pair of wirecutters.
<BR><BR>How they're classified: They're contraband, so it's perfectly okay for security officers to confiscate them. Punishment for contraband-providers (or end-users, if you want to go full nazi) is up to the situational commanding officers.
</ul>
</div>
+1
View File
@@ -748,6 +748,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\deadsay.dm"
#include "code\modules\admin\verbs\debug.dm"
#include "code\modules\admin\verbs\diagnostics.dm"