mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 22:17:32 +01:00
Goliath improvements
This commit is contained in:
@@ -1341,3 +1341,26 @@ var/list/slot_equipment_priority = list( \
|
||||
|
||||
/mob/proc/is_literate()
|
||||
return FALSE
|
||||
|
||||
/mob/proc/faction_check_mob(mob/target, exact_match)
|
||||
if(exact_match) //if we need an exact match, we need to do some bullfuckery.
|
||||
var/list/faction_src = faction.Copy()
|
||||
var/list/faction_target = target.faction.Copy()
|
||||
if(!("\ref[src]" in faction_target)) //if they don't have our ref faction, remove it from our factions list.
|
||||
faction_src -= "\ref[src]" //if we don't do this, we'll never have an exact match.
|
||||
if(!("\ref[target]" in faction_src))
|
||||
faction_target -= "\ref[target]" //same thing here.
|
||||
return faction_check(faction_src, faction_target, TRUE)
|
||||
return faction_check(faction, target.faction, FALSE)
|
||||
|
||||
/proc/faction_check(list/faction_A, list/faction_B, exact_match)
|
||||
var/list/match_list
|
||||
if(exact_match)
|
||||
match_list = faction_A&faction_B //only items in both lists
|
||||
var/length = LAZYLEN(match_list)
|
||||
if(length)
|
||||
return (length == LAZYLEN(faction_A)) //if they're not the same len(gth) or we don't have a len, then this isn't an exact match.
|
||||
else
|
||||
match_list = faction_A&faction_B
|
||||
return LAZYLEN(match_list)
|
||||
return FALSE
|
||||
Reference in New Issue
Block a user