mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
[MIRROR] Revert "Revert "Removed negative trait limit"" (#8866)
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Kashargul <KashL@t-online.de>
This commit is contained in:
@@ -300,8 +300,8 @@ var/global/list/valid_bloodreagents = list("default","iron","copper","phoron","s
|
||||
|
||||
for(var/T in pref.pos_traits + pref.neg_traits) // CHOMPEdit: Only Positive traits cost slots now.
|
||||
points_left -= traits_costs[T]
|
||||
for(var/T in pref.pos_traits)
|
||||
traits_left--
|
||||
if(T in pref.pos_traits)
|
||||
traits_left--
|
||||
. += "<b>Traits Left:</b> [traits_left]<br>"
|
||||
. += "<b>Points Left:</b> [points_left]<br>"
|
||||
if(points_left < 0 || traits_left < 0 || (!pref.custom_species && pref.species == SPECIES_CUSTOM))
|
||||
|
||||
@@ -45,36 +45,30 @@
|
||||
pass = FALSE
|
||||
to_chat(src,"<span class='warning'>You have to name your custom species. Do this on the VORE tab in character setup.</span>")
|
||||
|
||||
//Check traits/costs
|
||||
var/list/megalist = client.prefs.pos_traits + client.prefs.neu_traits + client.prefs.neg_traits
|
||||
var/points_left = client.prefs.starting_trait_points
|
||||
var/traits_left = client.prefs.max_traits
|
||||
var/pref_synth = client.prefs.dirty_synth
|
||||
var/pref_meat = client.prefs.gross_meatbag
|
||||
for(var/datum/trait/T as anything in megalist)
|
||||
var/cost = traits_costs[T]
|
||||
//Check traits/costs
|
||||
var/list/megalist = client.prefs.pos_traits + client.prefs.neu_traits + client.prefs.neg_traits
|
||||
var/points_left = client.prefs.starting_trait_points
|
||||
var/traits_left = client.prefs.max_traits
|
||||
var/pref_synth = client.prefs.dirty_synth
|
||||
var/pref_meat = client.prefs.gross_meatbag
|
||||
for(var/datum/trait/T as anything in megalist)
|
||||
var/cost = traits_costs[T]
|
||||
if(T.category == TRAIT_TYPE_POSITIVE)
|
||||
traits_left--
|
||||
|
||||
if(cost > 0) //CHOMPEdit
|
||||
traits_left--
|
||||
|
||||
//A trait was removed from the game
|
||||
if(isnull(cost))
|
||||
pass = FALSE
|
||||
to_chat(src,"<span class='warning'>Your custom species is not playable. One or more traits appear to have been removed from the game or renamed. Enter character setup to correct this.</span>")
|
||||
break
|
||||
else
|
||||
points_left -= traits_costs[T]
|
||||
|
||||
var/take_flags = initial(T.can_take)
|
||||
if((pref_synth && !(take_flags & SYNTHETICS)) || (pref_meat && !(take_flags & ORGANICS)))
|
||||
pass = FALSE
|
||||
to_chat(src, "<span class='warning'>Some of your traits are not usable by your character type (synthetic traits on organic, or vice versa).</span>")
|
||||
|
||||
//Went into negatives
|
||||
if(points_left < 0 || traits_left < 0)
|
||||
//A trait was removed from the game
|
||||
if(isnull(cost))
|
||||
pass = FALSE
|
||||
to_chat(src,"<span class='warning'>Your custom species is not playable. Reconfigure your traits on the VORE tab.</span>")
|
||||
//CHOMPadd start
|
||||
to_chat(src,"<span class='warning'>Your species is not playable. One or more traits appear to have been removed from the game or renamed. Enter character setup to correct this.</span>")
|
||||
break
|
||||
else
|
||||
points_left -= traits_costs[T]
|
||||
|
||||
var/take_flags = initial(T.can_take)
|
||||
if((pref_synth && !(take_flags & SYNTHETICS)) || (pref_meat && !(take_flags & ORGANICS)))
|
||||
pass = FALSE
|
||||
to_chat(src, "<span class='warning'>Some of your traits are not usable by your character type (synthetic traits on organic, or vice versa).</span>")
|
||||
//CHOMPadd start
|
||||
if(J.camp_protection && round_duration_in_ds < CONFIG_GET(number/job_camp_time_limit))
|
||||
if(SSjob.restricted_keys.len)
|
||||
var/list/check = SSjob.restricted_keys[J.title]
|
||||
@@ -95,6 +89,11 @@
|
||||
to_chat(src,"<span class='warning'>One of your traits, [instance.name], is not available for your species! Please fix this conflict and then try again.</span>")
|
||||
//CHOMP Addition End
|
||||
|
||||
//Went into negatives
|
||||
if(points_left < 0 || traits_left < 0)
|
||||
pass = FALSE
|
||||
to_chat(src,"<span class='warning'>Your species is not playable. Reconfigure your traits on the VORE tab. Trait points: [points_left]. Traits left: [traits_left].</span>")
|
||||
|
||||
//Final popup notice
|
||||
if (!pass)
|
||||
tgui_alert_async(src,"There were problems with spawning your character. Check your message log for details.","Error")
|
||||
|
||||
Reference in New Issue
Block a user