mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-30 00:29:02 +01:00
[MIRROR] Fixes progression scaling and other various problems with progression traitors. [MDB IGNORE] (#11323)
* Fixes progression scaling and other various problems with progression traitors. (#64503) Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com> * Fixes progression scaling and other various problems with progression traitors. Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Watermelon914 <3052169-Watermelon914@ users.noreply.gitlab.com>
This commit is contained in:
co-authored by
Watermelon914
Watermelon914
parent
c908a1d891
commit
57505db559
@@ -186,7 +186,8 @@ GLOBAL_VAR(antag_prototypes)
|
||||
var/uplink_info = "<i><b>Uplink</b></i>:"
|
||||
var/datum/component/uplink/U = find_syndicate_uplink()
|
||||
if(U)
|
||||
uplink_info += "<a href='?src=[REF(src)];common=takeuplink'>take</a>"
|
||||
if(!U.uplink_handler.has_objectives)
|
||||
uplink_info += "<a href='?src=[REF(src)];common=takeuplink'>take</a>"
|
||||
if (check_rights(R_FUN, 0))
|
||||
uplink_info += ", <a href='?src=[REF(src)];common=crystals'>[U.uplink_handler.telecrystals]</a> TC"
|
||||
if(U.uplink_handler.has_progression)
|
||||
|
||||
@@ -78,6 +78,11 @@
|
||||
|
||||
return ..()
|
||||
|
||||
/datum/antagonist/traitor/on_removal()
|
||||
if(uplink_handler)
|
||||
uplink_handler.has_objectives = FALSE
|
||||
return ..()
|
||||
|
||||
/datum/antagonist/traitor/proc/traitor_objective_to_html(datum/traitor_objective/to_display)
|
||||
var/string = "[to_display.name]"
|
||||
if(to_display.objective_state == OBJECTIVE_STATE_ACTIVE || to_display.objective_state == OBJECTIVE_STATE_INACTIVE)
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
if(global_progression_influence_intensity <= 0)
|
||||
return
|
||||
var/minimum_progression = progression_reward * global_progression_limit_coeff
|
||||
var/maximum_progression = global_progression_limit_coeff != 0? progression_reward / global_progression_limit_coeff : INFINITY
|
||||
var/maximum_progression = progression_reward * (2-global_progression_limit_coeff)
|
||||
var/deviance = (SStraitor.current_global_progression - handler.progression_points) / SStraitor.progression_scaling_deviance
|
||||
if(abs(deviance) < global_progression_deviance_required)
|
||||
return
|
||||
@@ -114,9 +114,13 @@
|
||||
deviance = deviance - global_progression_deviance_required
|
||||
else
|
||||
deviance = deviance + global_progression_deviance_required
|
||||
var/coeff = NUM_E ** (global_progression_influence_intensity * deviance) - 1
|
||||
// This has less of an effect as the coeff gets nearer to 1. Is linear
|
||||
coeff += progression_cost_coeff * (1 - coeff)
|
||||
var/coeff = NUM_E ** (global_progression_influence_intensity * abs(deviance)) - 1
|
||||
if(abs(deviance) != deviance)
|
||||
coeff *= -1
|
||||
|
||||
// This has less of an effect as the coeff gets nearer to -1. Is linear
|
||||
coeff += progression_cost_coeff * min(max(1 - abs(coeff), 1), 0)
|
||||
|
||||
|
||||
progression_reward = clamp(
|
||||
progression_reward + progression_reward * coeff,
|
||||
|
||||
@@ -177,8 +177,8 @@
|
||||
|
||||
/// Updates the objectives on the uplink and deletes
|
||||
/datum/uplink_handler/proc/update_objectives()
|
||||
var/list/potential_objectives_copy = potential_objectives.Copy()
|
||||
for(var/datum/traitor_objective/objective as anything in potential_objectives_copy)
|
||||
var/list/objectives_copy = potential_objectives + active_objectives
|
||||
for(var/datum/traitor_objective/objective as anything in objectives_copy)
|
||||
if(progression_points > objective.progression_maximum && !objective.forced)
|
||||
objective.fail_objective(trigger_update = FALSE)
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user