Skip to content

Commit

Permalink
Changeling Ability Changes
Browse files Browse the repository at this point in the history
I am attempting to not let changelings purchase abilities which are OP together.
  • Loading branch information
cowbot92 committed Jul 27, 2023
1 parent 3691d0a commit cecdc5c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 9 deletions.
22 changes: 13 additions & 9 deletions code/modules/antagonists/changeling/cellular_emporium.dm
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,21 @@
if(istype(changeling, /datum/antagonist/changeling/xenobio) && !xenoling_available)
continue //yogs end - removing combat abilities from xenolings

var/list/AL = list()
AL["name"] = initial(ability.name)
AL["desc"] = initial(ability.desc)
AL["helptext"] = initial(ability.helptext)
AL["owned"] = changeling.has_sting(ability)
var/list/abilitydata = list()
abilitydata["name"] = initial(ability.name)
abilitydata["desc"] = initial(ability.desc)
abilitydata["helptext"] = initial(ability.helptext)
abilitydata["owned"] = changeling.has_sting(ability)
var/req_dna = initial(ability.req_dna)
var/req_absorbs = initial(ability.req_absorbs)
AL["dna_cost"] = dna_cost
AL["can_purchase"] = ((req_absorbs <= true_absorbs) && (req_dna <= absorbed_dna_count) && (dna_cost <= genetic_points_remaining))

abilities += list(AL)
abilitydata["dna_cost"] = dna_cost
abilitydata["can_purchase"] = ((req_absorbs <= true_absorbs) && (req_dna <= absorbed_dna_count) && (dna_cost <= genetic_points_remaining))
abilitydata["conflicting_powers"] = list()
for(var/conflicts in ability.conflicts)
var/datum/action/changeling/conflcting_ability = conflicts
abilitydata["conflicting_powers"] += initial(conflcting_ability.name)

abilities += list(abilitydata)

data["abilities"] = abilities

Expand Down
5 changes: 5 additions & 0 deletions code/modules/antagonists/changeling/changeling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@
if(HAS_TRAIT(owner.current, TRAIT_DEATHCOMA))//To avoid potential exploits by buying new powers while in stasis, which clears your verblist.
to_chat(owner.current, "We lack the energy to evolve new abilities right now.")
return
//this checks for conflicting abilities that you dont want players to have at the same time (movement speed abilities for example)
for(var/conflictingpower in thepower.conflicts)
if(has_sting(conflictingpower))
to_chat(owner.current, "This power conflicts with another power we currently have!")
return

geneticpoints -= thepower.dna_cost
purchasedpowers += thepower
Expand Down
2 changes: 2 additions & 0 deletions code/modules/antagonists/changeling/changeling_power.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
var/ignores_fakedeath = FALSE // usable with the FAKEDEATH flag
var/active = FALSE //used by a few powers that toggle
var/xenoling_available = TRUE // Avaliable to xenolings
///list of power you cannot purchase together
var/list/conflicts = list()

/*
changeling code now relies on on_purchase to grant powers.
Expand Down
1 change: 1 addition & 0 deletions code/modules/antagonists/changeling/powers/adrenaline.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
dna_cost = 2
req_human = 1
req_stat = UNCONSCIOUS
conflicts = list(/datum/action/changeling/strained_muscles)

//Recover from stuns.
/datum/action/changeling/adrenaline/sting_action(mob/living/user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
req_human = 1
var/stacks = 0 //Increments every 5 seconds; damage increases over time
active = FALSE //Whether or not you are a hedgehog
conflicts = list(/datum/action/changeling/adrenaline)


/datum/action/changeling/strained_muscles/sting_action(mob/living/carbon/user)
..()
Expand Down
7 changes: 7 additions & 0 deletions tgui/packages/tgui/interfaces/CellularEmporium.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,13 @@ export const CellularEmporium = (props, context) => {
<Box color="good">
{ability.helptext}
</Box>
{!!ability.conflicting_powers && (
<Box color="bad">
{ability.conflicting_powers.forEach(power => {
power;
})}
</Box>
)}
</LabeledList.Item>
))}
</LabeledList>
Expand Down

0 comments on commit cecdc5c

Please sign in to comment.