mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-14 11:42:27 +00:00
[MIRROR] [Ready] Fermichem part 2.3 Adds a new reagent: Eigenstasium (#4445)
* [Ready] Fermichem part 2.3 Adds a new reagent: Eigenstasium * Update quirks.dm * Update closets.dm * aaaaaaa * Update lizardpeople.dm * Update mothmen.dm * Update species.dm * Update species.dm Co-authored-by: Thalpy <33956696+Thalpy@users.noreply.github.com> Co-authored-by: Gandalf <jzo123@hotmail.com> Co-authored-by: Azarak <azarak10@gmail.com>
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
#define EXP_ASSIGN_WAYFINDER 1200
|
||||
#define RANDOM_QUIRK_BONUS 3
|
||||
#define MINIMUM_RANDOM_QUIRKS 3
|
||||
//Used to process and handle roundstart quirks
|
||||
// - Quirk strings are used for faster checking in code
|
||||
// - Quirk datums are stored and hold different effects, as well as being a vector for applying trait string
|
||||
@@ -80,3 +82,68 @@ PROCESSING_SUBSYSTEM_DEF(quirks)
|
||||
for(var/V in cli.prefs.fooddislikes)
|
||||
H.dna.species.disliked_food |= cli.prefs.fooddislikes[V]
|
||||
// SKYRAT EDIT ADDITION END
|
||||
/*
|
||||
*Randomises the quirks for a specified mob
|
||||
*/
|
||||
/datum/controller/subsystem/processing/quirks/proc/randomise_quirks(mob/living/user)
|
||||
var/bonus_quirks = max((length(user.roundstart_quirks) + rand(-RANDOM_QUIRK_BONUS, RANDOM_QUIRK_BONUS)), MINIMUM_RANDOM_QUIRKS)
|
||||
var/added_quirk_count = 0 //How many we've added
|
||||
var/list/quirks_to_add = list() //Quirks we're adding
|
||||
var/good_count = 0 //Maximum of 6 good perks
|
||||
var/score //What point score we're at
|
||||
///Cached list of possible quirks
|
||||
var/list/possible_quirks = quirks.Copy()
|
||||
//Create a random list of stuff to start with
|
||||
while(bonus_quirks > added_quirk_count)
|
||||
var/quirk = pick(possible_quirks) //quirk is a string
|
||||
if(quirk in quirk_blacklist) //prevent blacklisted
|
||||
possible_quirks -= quirk
|
||||
continue
|
||||
if(quirk_points[quirk] > 0)
|
||||
good_count++
|
||||
score += quirk_points[quirk]
|
||||
quirks_to_add += quirk
|
||||
possible_quirks -= quirk
|
||||
added_quirk_count++
|
||||
|
||||
//But lets make sure we're balanced
|
||||
while(score > 0)
|
||||
if(!length(possible_quirks))//Lets not get stuck
|
||||
break
|
||||
var/quirk = pick(quirks)
|
||||
if(quirk in quirk_blacklist) //prevent blacklisted
|
||||
possible_quirks -= quirk
|
||||
continue
|
||||
if(!quirk_points[quirk] < 0)//negative only
|
||||
possible_quirks -= quirk
|
||||
continue
|
||||
good_count++
|
||||
score += quirk_points[quirk]
|
||||
quirks_to_add += quirk
|
||||
|
||||
//And have benefits too
|
||||
while(score < 0 && good_count <= MAX_QUIRKS)
|
||||
if(!length(possible_quirks))//Lets not get stuck
|
||||
break
|
||||
var/quirk = pick(quirks)
|
||||
if(quirk in quirk_blacklist) //prevent blacklisted
|
||||
possible_quirks -= quirk
|
||||
continue
|
||||
if(!quirk_points[quirk] > 0) //positive only
|
||||
possible_quirks -= quirk
|
||||
continue
|
||||
good_count++
|
||||
score += quirk_points[quirk]
|
||||
quirks_to_add += quirk
|
||||
|
||||
for(var/datum/quirk/quirk as anything in user.roundstart_quirks)
|
||||
if(quirk.name in quirks_to_add) //Don't delete ones we keep
|
||||
quirks_to_add -= quirk.name //Already there, no need to add.
|
||||
continue
|
||||
user.remove_quirk(quirk.type) //these quirks are objects
|
||||
|
||||
for(var/datum/quirk/quirk as anything in quirks_to_add)
|
||||
user.add_quirk(quirks[quirk], spawn_effects = TRUE)//these are typepaths converted from string
|
||||
|
||||
#undef RANDOM_QUIRK_BONUS
|
||||
#undef MINIMUM_RANDOM_QUIRKS
|
||||
|
||||
Reference in New Issue
Block a user