mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-27 10:32:40 +00:00
Mutiny Mode
This commit is contained in:
@@ -15,3 +15,73 @@
|
||||
* Called in gameticker.dm when a round ends.
|
||||
*/
|
||||
/hook/roundend
|
||||
|
||||
/**
|
||||
* Death hook.
|
||||
* Called in death.dm when someone dies.
|
||||
* Parameters: var/mob/living/carbon/human, var/gibbed
|
||||
*/
|
||||
/hook/death
|
||||
|
||||
/**
|
||||
* Cloning hook.
|
||||
* Called in cloning.dm when someone is brought back by the wonders of modern science.
|
||||
* Parameters: var/mob/living/carbon/human
|
||||
*/
|
||||
/hook/clone
|
||||
|
||||
/**
|
||||
* Debrained hook.
|
||||
* Called in brain_item.dm when someone gets debrained.
|
||||
* Parameters: var/obj/item/brain
|
||||
*/
|
||||
/hook/debrain
|
||||
|
||||
/**
|
||||
* Borged hook.
|
||||
* Called in robot_parts.dm when someone gets turned into a cyborg.
|
||||
* Parameters: var/mob/living/silicon/robot
|
||||
*/
|
||||
/hook/borgify
|
||||
|
||||
/**
|
||||
* Podman hook.
|
||||
* Called in podmen.dm when someone is brought back as a Diona.
|
||||
* Parameters: var/mob/living/carbon/monkey/diona
|
||||
*/
|
||||
/hook/harvest_podman
|
||||
|
||||
/**
|
||||
* Payroll revoked hook.
|
||||
* Called in Accounts_DB.dm when someone's payroll is stolen at the Accounts terminal.
|
||||
* Parameters: var/datum/money_account
|
||||
*/
|
||||
/hook/revoke_payroll
|
||||
|
||||
/**
|
||||
* Account suspension hook.
|
||||
* Called in Accounts_DB.dm when someone's account is suspended or unsuspended at the Accounts terminal.
|
||||
* Parameters: var/datum/money_account
|
||||
*/
|
||||
/hook/change_account_status
|
||||
|
||||
/**
|
||||
* Employee reassignment hook.
|
||||
* Called in card.dm when someone's card is reassigned at the HoP's desk.
|
||||
* Parameters: var/obj/item/weapon/card/id
|
||||
*/
|
||||
/hook/reassign_employee
|
||||
|
||||
/**
|
||||
* Employee terminated hook.
|
||||
* Called in card.dm when someone's card is terminated at the HoP's desk.
|
||||
* Parameters: var/obj/item/weapon/card/id
|
||||
*/
|
||||
/hook/terminate_employee
|
||||
|
||||
/**
|
||||
* Crate sold hook.
|
||||
* Called in supplyshuttle.dm when a crate is sold on the shuttle.
|
||||
* Parameters: var/obj/structure/closet/crate/sold, var/area/shuttle
|
||||
*/
|
||||
/hook/sell_crate
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* @param hook Identifier of the hook to call.
|
||||
* @returns 1 if all hooked code runs successfully, 0 otherwise.
|
||||
*/
|
||||
/proc/callHook(hook)
|
||||
/proc/callHook(hook, list/args=null)
|
||||
var/hook_path = text2path("/hook/[hook]")
|
||||
if(!hook_path)
|
||||
error("Invalid hook '/hook/[hook]' called.")
|
||||
@@ -32,7 +32,7 @@
|
||||
var/caller = new hook_path
|
||||
var/status = 1
|
||||
for(var/P in typesof("[hook_path]/proc"))
|
||||
if(!call(caller, P)())
|
||||
if(!call(caller, P)(arglist(args)))
|
||||
error("Hook '[P]' failed or runtimed.")
|
||||
status = 0
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ datum/shuttle_controller
|
||||
if(direction == -1)
|
||||
setdirection(1)
|
||||
else
|
||||
settimeleft(SHUTTLEARRIVETIME*coeff)
|
||||
settimeleft(get_shuttle_arrive_time()*coeff)
|
||||
online = 1
|
||||
if(always_fake_recall)
|
||||
fake_recall = rand(300,500) //turning on the red lights in hallways
|
||||
@@ -45,10 +45,16 @@ datum/shuttle_controller
|
||||
if(istype(A, /area/hallway))
|
||||
A.readyalert()
|
||||
|
||||
proc/get_shuttle_arrive_time()
|
||||
// During mutiny rounds, the shuttle takes twice as long.
|
||||
if(ticker && istype(ticker.mode,/datum/game_mode/mutiny))
|
||||
return SHUTTLEARRIVETIME * 2
|
||||
|
||||
return SHUTTLEARRIVETIME
|
||||
|
||||
datum/shuttle_controller/proc/shuttlealert(var/X)
|
||||
alert = X
|
||||
|
||||
|
||||
datum/shuttle_controller/proc/recall()
|
||||
if(direction == 1)
|
||||
var/timeleft = timeleft()
|
||||
@@ -78,9 +84,9 @@ datum/shuttle_controller/proc/timeleft()
|
||||
if(direction == 1 || direction == 2)
|
||||
return timeleft
|
||||
else
|
||||
return SHUTTLEARRIVETIME-timeleft
|
||||
return get_shuttle_arrive_time()-timeleft
|
||||
else
|
||||
return SHUTTLEARRIVETIME
|
||||
return get_shuttle_arrive_time()
|
||||
|
||||
// sets the time left to a given delay (in seconds)
|
||||
datum/shuttle_controller/proc/settimeleft(var/delay)
|
||||
@@ -95,7 +101,7 @@ datum/shuttle_controller/proc/setdirection(var/dirn)
|
||||
direction = dirn
|
||||
// if changing direction, flip the timeleft by SHUTTLEARRIVETIME
|
||||
var/ticksleft = endtime - world.timeofday
|
||||
endtime = world.timeofday + (SHUTTLEARRIVETIME*10 - ticksleft)
|
||||
endtime = world.timeofday + (get_shuttle_arrive_time()*10 - ticksleft)
|
||||
return
|
||||
|
||||
datum/shuttle_controller/proc/process()
|
||||
|
||||
Reference in New Issue
Block a user