Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into vore-optimization
This commit is contained in:
@@ -63,23 +63,34 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars_by_type, typecacheof_assoc_list(list(
|
||||
|
||||
var/src_min_x = 99999
|
||||
var/src_min_y = 99999
|
||||
var/src_max_x = 0
|
||||
var/src_max_y = 0
|
||||
var/list/refined_src = new/list()
|
||||
|
||||
for (var/turf/T in turfs_src)
|
||||
src_min_x = min(src_min_x,T.x)
|
||||
src_min_y = min(src_min_y,T.y)
|
||||
src_max_x = max(src_max_x,T.y)
|
||||
src_max_y = max(src_max_y,T.y)
|
||||
for (var/turf/T in turfs_src)
|
||||
refined_src[T] = "[T.x - src_min_x].[T.y - src_min_y]"
|
||||
|
||||
var/trg_min_x = 99999
|
||||
var/trg_min_y = 99999
|
||||
var/trg_max_x = 0
|
||||
var/trg_max_y = 0
|
||||
var/list/refined_trg = new/list()
|
||||
|
||||
for (var/turf/T in turfs_trg)
|
||||
trg_min_x = min(trg_min_x,T.x)
|
||||
trg_min_y = min(trg_min_y,T.y)
|
||||
trg_max_x = max(trg_max_x,T.y)
|
||||
trg_max_y = max(trg_max_y,T.y)
|
||||
|
||||
var/diff_x = round(((src_max_x - src_min_x) - (trg_max_x - trg_min_x))/2)
|
||||
var/diff_y = round(((src_max_y - src_min_y) - (trg_max_y - trg_min_y))/2)
|
||||
for (var/turf/T in turfs_trg)
|
||||
refined_trg["[T.x - trg_min_x].[T.y - trg_min_y]"] = T
|
||||
refined_trg["[T.x - trg_min_x + diff_x].[T.y - trg_min_y + diff_y]"] = T
|
||||
|
||||
var/list/toupdate = new/list()
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
Holodeck Update
|
||||
|
||||
The on-station holodeck area is of type [holodeck_type].
|
||||
All subtypes of [program_type] are loaded into the program cache or emag programs list.
|
||||
All types found in GLOB.holodeck_areas_per_comp_type[src.type], generated on make_datum_references_lists(),
|
||||
are loaded into the program cache or emag programs list.
|
||||
Paths with their abstract_type variable equal to themselves will be skipped.
|
||||
|
||||
If init_program is null, a random program will be loaded on startup.
|
||||
If you don't wish this, set it to the offline program or another of your choosing.
|
||||
|
||||
@@ -12,7 +15,6 @@
|
||||
3) Create a new control console that uses those areas
|
||||
|
||||
Non-mapped areas should be skipped but you should probably comment them out anyway.
|
||||
The base of program_type will always be ignored; only subtypes will be loaded.
|
||||
*/
|
||||
|
||||
#define HOLODECK_CD 25
|
||||
@@ -35,7 +37,6 @@
|
||||
// Splitting this up allows two holodecks of the same size
|
||||
// to use the same source patterns. Y'know, if you want to.
|
||||
var/holodeck_type = /area/holodeck/rec_center // locate(this) to get the target holodeck
|
||||
var/program_type = /area/holodeck/rec_center // subtypes of this (but not this itself) are loadable programs
|
||||
|
||||
var/active = FALSE
|
||||
var/damaged = FALSE
|
||||
@@ -181,7 +182,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/machinery/computer/holodeck/proc/generate_program_list()
|
||||
for(var/typekey in subtypesof(program_type))
|
||||
for(var/typekey in GLOB.holodeck_areas_prototypes[type])
|
||||
var/area/holodeck/A = GLOB.areas_by_type[typekey]
|
||||
if(!A || !A.contents.len)
|
||||
continue
|
||||
|
||||
@@ -24,15 +24,16 @@
|
||||
hitsound = "swing_hit"
|
||||
armour_penetration = 50
|
||||
var/active = 0
|
||||
var/saber_color
|
||||
|
||||
/obj/item/holo/esword/green/Initialize()
|
||||
. = ..()
|
||||
item_color = "green"
|
||||
saber_color = "green"
|
||||
|
||||
|
||||
/obj/item/holo/esword/red/Initialize()
|
||||
. = ..()
|
||||
item_color = "red"
|
||||
saber_color = "red"
|
||||
|
||||
/obj/item/holo/esword/run_block(mob/living/owner, atom/object, damage, attack_text, attack_type, armour_penetration, mob/attacker, def_zone, final_block_chance, list/block_return)
|
||||
if(!active)
|
||||
@@ -44,13 +45,13 @@
|
||||
|
||||
/obj/item/holo/esword/Initialize()
|
||||
. = ..()
|
||||
item_color = pick("red","blue","green","purple")
|
||||
saber_color = pick("red","blue","green","purple")
|
||||
|
||||
/obj/item/holo/esword/attack_self(mob/living/user as mob)
|
||||
active = !active
|
||||
if (active)
|
||||
force = 30
|
||||
icon_state = "sword[item_color]"
|
||||
icon_state = "sword[saber_color]"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
hitsound = 'sound/weapons/blade1.ogg'
|
||||
playsound(user, 'sound/weapons/saberon.ogg', 20, 1)
|
||||
|
||||
Reference in New Issue
Block a user