Merge branch 'master' into final_shuttle_touches_and_stuff

# Conflicts:
#	icons/turf/shuttle.dmi
This commit is contained in:
alberyk
2022-01-17 22:20:15 -03:00
84 changed files with 2321 additions and 4654 deletions
+22
View File
@@ -0,0 +1,22 @@
// Observer Pattern Implementation: Death
// Registration type: /mob
//
// Raised when: A mob is added to the dead_mob_list
//
// Arguments that the called proc should expect:
// /mob/dead: The mob that was added to the dead_mob_list
var/datum/observ/death/death_event = new()
/datum/observ/death
name = "Death"
expected_type = /mob
/*****************
* Death Handling *
*****************/
/mob/living/add_to_dead_mob_list()
. = ..()
if(.)
death_event.raise_event(src)
+38
View File
@@ -0,0 +1,38 @@
// Observer Pattern Implementation: Shuttle Moved
// Registration type: /datum/shuttle/autodock
//
// Raised when: A shuttle has moved to a new landmark.
//
// Arguments that the called proc should expect:
// /datum/shuttle/shuttle: the shuttle moving
// /obj/effect/shuttle_landmark/old_location: the old location's shuttle landmark
// /obj/effect/shuttle_landmark/new_location: the new location's shuttle landmark
// Observer Pattern Implementation: Shuttle Pre Move
// Registration type: /datum/shuttle/autodock
//
// Raised when: A shuttle is about to move to a new landmark.
//
// Arguments that the called proc should expect:
// /datum/shuttle/shuttle: the shuttle moving
// /obj/effect/shuttle_landmark/old_location: the old location's shuttle landmark
// /obj/effect/shuttle_landmark/new_location: the new location's shuttle landmark
var/datum/observ/shuttle_moved/shuttle_moved_event = new()
/datum/observ/shuttle_moved
name = "Shuttle Moved"
expected_type = /datum/shuttle
var/datum/observ/shuttle_pre_move/shuttle_pre_move_event = new()
/datum/observ/shuttle_pre_move
name = "Shuttle Pre Move"
expected_type = /datum/shuttle
/*****************
* Shuttle Moved/Pre Move Handling *
*****************/
// Located in modules/shuttle/shuttle.dm
// Proc: /datum/shuttle/proc/attempt_move()
+70
View File
@@ -0,0 +1,70 @@
var/repository/unique/uniqueness_repository = new()
/repository/unique
var/list/generators
/repository/unique/New()
..()
generators = list()
/repository/unique/proc/Generate()
var/generator_type = args[1]
var/datum/uniqueness_generator/generator = generators[generator_type]
if(!generator)
generator = new generator_type()
generators[generator_type] = generator
var/list/generator_args = args.Copy() // Cannot cut args directly, BYOND complains about it being readonly.
generator_args -= generator_type
return generator.Generate(arglist(generator_args))
/datum/uniqueness_generator/proc/Generate()
return
/datum/uniqueness_generator/id_sequential
var/list/ids_by_key
/datum/uniqueness_generator/id_sequential/New()
..()
ids_by_key = list()
/datum/uniqueness_generator/id_sequential/Generate(var/key, var/default_id = 100)
var/id = ids_by_key[key]
if(id)
id++
else
id = default_id
ids_by_key[key] = id
. = id
/datum/uniqueness_generator/id_random
var/list/ids_by_key
/datum/uniqueness_generator/id_random/New()
..()
ids_by_key = list()
/datum/uniqueness_generator/id_random/Generate(var/key, var/min, var/max)
var/list/ids = ids_by_key[key]
if(!ids)
ids = list()
ids_by_key[key] = ids
if(ids.len >= (max - min) + 1)
error("Random ID limit reached for key [key].")
ids.Cut()
if(ids.len >= 0.6 * ((max-min) + 1)) // if more than 60% of possible ids used
. = list()
for(var/i = min to max)
if(i in ids)
continue
. += i
var/id = pick(.)
ids += id
return id
else
do
. = rand(min, max)
while(. in ids)
ids += .
+20
View File
@@ -0,0 +1,20 @@
/datum/map_template/ruin
//name = "A Chest of Doubloons"
name = null
var/description = "In the middle of a clearing in the rockface, there's a chest filled with gold coins with Spanish engravings. \
How is there a wooden container filled with 18th century coinage in the middle of a lavawracked hellscape? \
It is clearly a mystery."
var/spawn_weight = 1
var/cost = null
var/list/sectors = list() //This ruin can only spawn in the sectors in this list.
var/prefix = null
var/suffix = null
template_flags = 0 // No duplicates by default
/datum/map_template/ruin/New()
if (suffix)
mappath += (prefix + suffix)
..()
+3 -3
View File
@@ -26,9 +26,9 @@
/mob/living/simple_animal/mushroom = TRADER_THIS_TYPE,
/mob/living/simple_animal/tomato = TRADER_THIS_TYPE,
/mob/living/simple_animal/rat/king = TRADER_THIS_TYPE,
/mob/living/simple_animal/hostile/diyaab = TRADER_THIS_TYPE,
/mob/living/simple_animal/hostile/shantak = TRADER_THIS_TYPE,
/mob/living/simple_animal/hostile/samak = TRADER_THIS_TYPE,
/mob/living/simple_animal/hostile/retaliate/diyaab = TRADER_THIS_TYPE,
/mob/living/simple_animal/hostile/retaliate/shantak = TRADER_THIS_TYPE,
/mob/living/simple_animal/hostile/retaliate/samak = TRADER_THIS_TYPE,
/mob/living/simple_animal/hostile/bear = TRADER_ALL,
/mob/living/simple_animal/hostile/carp = TRADER_ALL,
/mob/living/simple_animal/hostile/biglizard = TRADER_THIS_TYPE,