mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 08:08:49 +01:00
faction fixes that i probably broke
This commit is contained in:
@@ -94,7 +94,7 @@
|
||||
var/mob/living/pawn = controller.pawn
|
||||
var/list/valid_mobs = list()
|
||||
for(var/mob/living/iterating_mob in view(DEFAULT_VIEW_RANGE, controller.pawn))
|
||||
if(faction_check(iterating_mob.faction, pawn.faction))
|
||||
if(iterating_mob.faction_check_atom(iterating_mob.get_faction(), pawn.get_faction()))
|
||||
if(iterating_mob.health < iterating_mob.maxHealth * 0.5)
|
||||
valid_mobs += iterating_mob
|
||||
if(!LAZYLEN(valid_mobs))
|
||||
@@ -134,7 +134,7 @@
|
||||
for(var/mob/living/iterating_mobs in view(search_range, pawn))
|
||||
if(iterating_mobs == pawn)
|
||||
continue
|
||||
if(faction_check(pawn.faction, iterating_mobs.faction))
|
||||
if(iterating_mobs.faction_check_atom(pawn.get_faction(), iterating_mobs.get_faction()))
|
||||
continue
|
||||
if(iterating_mobs.health < (iterating_mobs.maxHealth * MECHIVER_CONSUME_HEALTH_THRESHOLD))
|
||||
corpses += iterating_mobs
|
||||
@@ -150,7 +150,7 @@
|
||||
var/mob/living/target = controller.blackboard[target_key]
|
||||
if(QDELETED(target))
|
||||
return FALSE
|
||||
if(faction_check(pawn.faction, target.faction))
|
||||
if(pawn.faction_check_atom(pawn.get_faction(), target.get_faction()))
|
||||
return FALSE
|
||||
if(target.health > (target.maxHealth * MECHIVER_CONSUME_HEALTH_THRESHOLD)) // Don't do this
|
||||
return FALSE
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
/datum/action/cooldown/fleshmind_flesh_call/Activate(atom/target)
|
||||
for(var/mob/living/basic/fleshmind/iterating_mob in view(DEFAULT_VIEW_RANGE, owner))
|
||||
if(faction_check(owner.faction, iterating_mob))
|
||||
if(iterating_mob.faction_check_atom(owner.get_faction(), iterating_mob))
|
||||
continue
|
||||
iterating_mob.ai_controller.set_blackboard_key(BB_BASIC_MOB_REINFORCEMENT_TARGET, owner.loc)
|
||||
owner.visible_message(span_warning("[owner] lets out a horrible screech!"), span_notice("You let out a calling screech!"))
|
||||
|
||||
@@ -1157,8 +1157,6 @@
|
||||
for(var/mob/living/possible_target in view(DEFAULT_VIEW_RANGE, phaser_owner))
|
||||
if(possible_target == src)
|
||||
continue
|
||||
if(!phaser_owner.faction != possible_target)
|
||||
continue
|
||||
possible_targets += possible_target
|
||||
|
||||
if(!LAZYLEN(possible_targets))
|
||||
|
||||
@@ -68,12 +68,6 @@ GLOBAL_LIST_INIT(pp_limbs, list(
|
||||
.["mob_scale"] = living_mob.current_size
|
||||
.["mob_speed"] = living_mob.cached_multiplicative_slowdown
|
||||
.["mob_status_flags"] = living_mob.status_flags
|
||||
if(islist(living_mob.faction))
|
||||
.["current_faction"] = living_mob.faction
|
||||
else if(living_mob.faction)
|
||||
.["current_faction"] = list(living_mob.faction)
|
||||
else
|
||||
.["current_faction"] = list()
|
||||
|
||||
.["discord_id"] = discord_id_cache
|
||||
|
||||
@@ -722,46 +716,6 @@ GLOBAL_LIST_INIT(pp_limbs, list(
|
||||
log_admin("[key_name(admin_client)] reset speed modifier of [key_name(target_mob)].")
|
||||
return TRUE
|
||||
|
||||
/// Adds a faction to the selected mob
|
||||
if ("add_faction")
|
||||
var/mob/living/living_mob = target_mob
|
||||
if(!istype(living_mob))
|
||||
return FALSE
|
||||
|
||||
var/new_faction = params["faction"]
|
||||
if(new_faction == "Custom")
|
||||
new_faction = tgui_input_text(admin_client, "Enter custom faction name:", "Custom Faction")
|
||||
if(!new_faction)
|
||||
return FALSE
|
||||
|
||||
if(!living_mob.faction)
|
||||
living_mob.faction = list()
|
||||
else if(!islist(living_mob.faction))
|
||||
living_mob.faction = list(living_mob.faction)
|
||||
|
||||
if(!(new_faction in living_mob.faction))
|
||||
living_mob.faction += new_faction
|
||||
|
||||
log_admin("[key_name(admin_client)] added faction [new_faction] to [key_name(target_mob)].")
|
||||
message_admins(span_adminnotice("[key_name_admin(admin_client)] added faction [new_faction] to [key_name_admin(target_mob)]."))
|
||||
return TRUE
|
||||
|
||||
/// Removes a faction from the selected mob
|
||||
if ("remove_faction")
|
||||
var/mob/living/living_mob = target_mob
|
||||
if(!istype(living_mob))
|
||||
return FALSE
|
||||
|
||||
var/faction_to_remove = params["faction"]
|
||||
if(!living_mob.faction || !islist(living_mob.faction))
|
||||
return FALSE
|
||||
|
||||
LAZYREMOVE(living_mob.faction, faction_to_remove)
|
||||
|
||||
log_admin("[key_name(admin_client)] removed faction [faction_to_remove] from [key_name(target_mob)].")
|
||||
message_admins(span_adminnotice("[key_name_admin(admin_client)] removed faction [faction_to_remove] from [key_name_admin(target_mob)]."))
|
||||
return TRUE
|
||||
|
||||
/// Loads the client's preferences onto the selected human mob
|
||||
if ("load_preferences")
|
||||
var/mob/living/carbon/human/human_mob = target_mob
|
||||
|
||||
Reference in New Issue
Block a user