forked from Civ13/Civ13
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Civ13#2782 from Bierkraan/working-branch
Update to RU civ
- Loading branch information
Showing
185 changed files
with
8,772 additions
and
1,412 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,6 +29,7 @@ map_backups/ | |
maps/test/ | ||
tts/ | ||
config/host.txt | ||
maps/campaign/campaign8.dmm | ||
civ13od.dme | ||
odcomp.bat | ||
|
||
config/host.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// 515 split call for external libraries into call_ext | ||
#if DM_VERSION < 515 | ||
#define LIBCALL call | ||
#else | ||
#define LIBCALL call_ext | ||
#endif | ||
|
||
// Спизженно с фарвеба | ||
|
||
/proc/auxtools_stack_trace(msg) | ||
CRASH(msg) | ||
|
||
/proc/enable_debugging(mode, port) | ||
CRASH("auxtools not loaded") | ||
|
||
/world/New() | ||
var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") | ||
if (debug_server) | ||
LIBCALL(debug_server, "auxtools_init")() | ||
enable_debugging() | ||
. = ..() | ||
|
||
/world/Del() | ||
var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") | ||
if (debug_server) | ||
LIBCALL(debug_server, "auxtools_shutdown")() | ||
. = ..() | ||
|
||
/proc/auxtools_expr_stub() |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// This file contains defines allowing targeting byond versions newer than the supported | ||
|
||
//Update this whenever you need to take advantage of more recent byond features | ||
#define MIN_COMPILER_VERSION 515 | ||
#define MIN_COMPILER_BUILD 1610 | ||
#if (DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD) && !defined(SPACEMAN_DMM) | ||
//Don't forget to update this part | ||
#error Your version of BYOND is too out-of-date to compile this project. Go to https://secure.byond.com/download and update. | ||
#error You need version 515.1610 or higher | ||
#endif | ||
|
||
// Keep savefile compatibilty at minimum supported level | ||
/savefile/byond_version = MIN_COMPILER_VERSION | ||
|
||
// So we want to have compile time guarantees these methods exist on local type | ||
// We use wrappers for this in case some part of the api ever changes, and to make their function more clear | ||
// For the record: GLOBAL_VERB_REF would be useless as verbs can't be global. | ||
|
||
/// Call by name proc references, checks if the proc exists on either this type or as a global proc. | ||
#define PROC_REF(X) (nameof(.proc/##X)) | ||
/// Call by name verb references, checks if the verb exists on either this type or as a global verb. | ||
#define VERB_REF(X) (nameof(.verb/##X)) | ||
|
||
/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc | ||
#define TYPE_PROC_REF(TYPE, X) (nameof(##TYPE.proc/##X)) | ||
/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb | ||
#define TYPE_VERB_REF(TYPE, X) (nameof(##TYPE.verb/##X)) | ||
|
||
/// Call by name proc reference, checks if the proc is an existing global proc | ||
#define GLOBAL_PROC_REF(X) (/proc/##X) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,113 @@ | ||
#define MC_TICK_CHECK ( ( TICK_USAGE > Master.current_ticklimit || src.state != SS_RUNNING ) ? pause() : 0 ) | ||
|
||
#define MC_SPLIT_TICK_INIT(phase_count) var/original_tick_limit = Master.current_ticklimit; var/split_tick_phases = ##phase_count | ||
#define MC_SPLIT_TICK \ | ||
if(split_tick_phases > 1){\ | ||
Master.current_ticklimit = ((original_tick_limit - TICK_USAGE) / split_tick_phases) + TICK_USAGE;\ | ||
--split_tick_phases;\ | ||
} else {\ | ||
Master.current_ticklimit = original_tick_limit;\ | ||
} | ||
|
||
// Used to smooth out costs to try and avoid oscillation. | ||
#define MC_AVERAGE_FAST(average, current) (0.7 * (average) + 0.3 * (current)) | ||
#define MC_AVERAGE(average, current) (0.8 * (average) + 0.2 * (current)) | ||
#define MC_AVERAGE_SLOW(average, current) (0.9 * (average) + 0.1 * (current)) | ||
|
||
#define MC_AVG_FAST_UP_SLOW_DOWN(average, current) (average > current ? MC_AVERAGE_SLOW(average, current) : MC_AVERAGE_FAST(average, current)) | ||
#define MC_AVG_SLOW_UP_FAST_DOWN(average, current) (average < current ? MC_AVERAGE_SLOW(average, current) : MC_AVERAGE_FAST(average, current)) | ||
|
||
#define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;} | ||
|
||
#define START_PROCESSING(Processor, Datum) \ | ||
if (Datum.is_processing) {\ | ||
if(Datum.is_processing != #Processor)\ | ||
{\ | ||
crash_with("Failed to start processing. [log_info_line(Datum)] is already being processed by [Datum.is_processing] but queue attempt occured on [#Processor]."); \ | ||
}\ | ||
} else {\ | ||
Datum.is_processing = #Processor;\ | ||
Processor.processing += Datum;\ | ||
} | ||
|
||
#define STOP_PROCESSING(Processor, Datum) \ | ||
if(Datum.is_processing) {\ | ||
if(Processor.processing.Remove(Datum)) {\ | ||
Datum.is_processing = null;\ | ||
} else {\ | ||
crash_with("Failed to stop processing. [log_info_line(Datum)] is being processed by [Datum.is_processing] but de-queue attempt occured on [#Processor]."); \ | ||
}\ | ||
} | ||
|
||
// For SSmachines, use these instead | ||
|
||
#define START_PROCESSING_MACHINE(machine, flag)\ | ||
if(!istype(machine, /obj/machinery)) CRASH("A non-machine [log_info_line(machine)] was queued to process on the machinery subsystem.");\ | ||
machine.processing_flags |= flag;\ | ||
START_PROCESSING(SSmachines, machine) | ||
|
||
#define STOP_PROCESSING_MACHINE(machine, flag)\ | ||
machine.processing_flags &= ~flag;\ | ||
if(machine.processing_flags == 0) STOP_PROCESSING(SSmachines, machine) | ||
|
||
//SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier) | ||
|
||
//subsystem does not initialize. | ||
#define SS_NO_INIT 1 | ||
|
||
//subsystem does not fire. | ||
// (like can_fire = 0, but keeps it from getting added to the processing subsystems list) | ||
// (Requires a MC restart to change) | ||
#define SS_NO_FIRE 2 | ||
|
||
//subsystem only runs on spare cpu (after all non-background subsystems have ran that tick) | ||
// SS_BACKGROUND has its own priority bracket | ||
#define SS_BACKGROUND 4 | ||
|
||
//subsystem does not tick check, and should not run unless there is enough time (or its running behind (unless background)) | ||
#define SS_NO_TICK_CHECK 8 | ||
|
||
//Treat wait as a tick count, not DS, run every wait ticks. | ||
// (also forces it to run first in the tick, above even SS_NO_TICK_CHECK subsystems) | ||
// (implies all runlevels because of how it works) | ||
// (overrides SS_BACKGROUND) | ||
// This is designed for basically anything that works as a mini-mc (like SStimer) | ||
#define SS_TICKER 16 | ||
|
||
//keep the subsystem's timing on point by firing early if it fired late last fire because of lag | ||
// ie: if a 20ds subsystem fires say 5 ds late due to lag or what not, its next fire would be in 15ds, not 20ds. | ||
#define SS_KEEP_TIMING 32 | ||
|
||
//Calculate its next fire after its fired. | ||
// (IE: if a 5ds wait SS takes 2ds to run, its next fire should be 5ds away, not 3ds like it normally would be) | ||
// This flag overrides SS_KEEP_TIMING | ||
#define SS_POST_FIRE_TIMING 64 | ||
|
||
// Run Shutdown() on server shutdown so the SS can finalize state. | ||
#define SS_NEEDS_SHUTDOWN 128 | ||
|
||
#define GAME_STATE 2 ** (Master.current_runlevel - 1) | ||
|
||
//! SUBSYSTEM STATES | ||
#define SS_IDLE 0 /// ain't doing shit. | ||
#define SS_QUEUED 1 /// queued to run | ||
#define SS_RUNNING 2 /// actively running | ||
#define SS_PAUSED 3 /// paused by mc_tick_check | ||
#define SS_SLEEPING 4 /// fire() slept. | ||
#define SS_PAUSING 5 /// in the middle of pausing | ||
|
||
#define SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/##X);\ | ||
/datum/controller/subsystem/##X/New(){\ | ||
NEW_SS_GLOBAL(SS##X);\ | ||
PreInit();\ | ||
}\ | ||
/datum/controller/subsystem/##X | ||
|
||
#define PROCESSING_SUBSYSTEM_DEF(X) GLOBAL_REAL(SS##X, /datum/controller/subsystem/processing/##X);\ | ||
/datum/controller/subsystem/processing/##X/New(){\ | ||
NEW_SS_GLOBAL(SS##X);\ | ||
PreInit();\ | ||
}\ | ||
/datum/controller/subsystem/processing/##X | ||
|
||
#define log_qdel(X) log_debug(X) |
Oops, something went wrong.