Skip to content

Commit

Permalink
New skills.
Browse files Browse the repository at this point in the history
GitOrigin-RevId: e79566876536aa2bdd233ceba7e223147af39079
  • Loading branch information
cpojer committed Feb 26, 2025
1 parent b2d8adb commit 078ecbf
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 2 deletions.
40 changes: 40 additions & 0 deletions athena/info/Skill.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ export enum Skill {
DragonSaboteur = 40,
HighTide = 41,
Jeep = 42,
ShipIncreaseAttackAndRange = 43,
XFighterAttackIncrase = 44,
}

export const Skills = new Set<Skill>([
Expand Down Expand Up @@ -90,6 +92,8 @@ export const Skills = new Set<Skill>([
Skill.UnitAbilitySniperImmediateAction,
Skill.UnitInfantryForestAttackAndDefenseIncrease,
Skill.UnitRailDefenseIncreasePowerAttackIncrease,
Skill.ShipIncreaseAttackAndRange,
Skill.XFighterAttackIncrase,
Skill.DragonSaboteur,
Skill.Jeep,
Skill.RecoverAirUnits,
Expand Down Expand Up @@ -303,6 +307,16 @@ const skillConfig: Record<
requiresCrystal,
},
[Skill.Jeep]: { charges: 2, cost: 800, group: SkillGroup.Special },
[Skill.ShipIncreaseAttackAndRange]: {
charges: 3,
cost: 1000,
group: SkillGroup.Attack,
},
[Skill.XFighterAttackIncrase]: {
charges: 4,
cost: 1200,
group: SkillGroup.Special,
},
};

export const CampaignOnlySkills = new Set(
Expand Down Expand Up @@ -368,6 +382,7 @@ const attackUnitStatusEffects = new Map<Skill, SkillUnitModifierMap>([
[Skill.VampireHeal, new Map([[UnitID.Medic, 0.5]])],
[Skill.DragonSaboteur, new Map([[UnitID.Dragon, 0.1]])],
[Skill.HealInfantryMedicPower, new Map([[UnitID.Medic, 0.5]])],
[Skill.XFighterAttackIncrase, new Map([[UnitID.XFighter, 0.2]])],
]);

const attackPowerStatusEffects: SkillMap = new Map([
Expand All @@ -388,10 +403,29 @@ const attackUnitPowerStatusEffects: UnitSkillMap = new Map([
]),
],
[Skill.HealInfantryMedicPower, new Map([[UnitID.Medic, 2]])],
[Skill.XFighterAttackIncrase, new Map([[UnitID.XFighter, 0.5]])],
]);

const attackMovementTypeStatusEffects: MovementSkillMap = new Map([
[Skill.HighTide, new Map([[MovementTypes.Ship, 0.2]])],
[
Skill.ShipIncreaseAttackAndRange,
new Map([
[MovementTypes.Ship, 0.15],
[MovementTypes.Amphibious, 0.15],
[MovementTypes.Air, -0.15],
[MovementTypes.LowAltitude, -0.15],
]),
],
[
Skill.XFighterAttackIncrase,
new Map([
[MovementTypes.Air, 0.1],
[MovementTypes.LowAltitude, 0.1],
[MovementTypes.Amphibious, -0.15],
[MovementTypes.Ship, -0.15],
]),
],
]);

const attackMovementTypePowerStatusEffects: MovementSkillMap = new Map([
Expand Down Expand Up @@ -549,6 +583,7 @@ const skillRangePowerEffects = new Map<number, RangeSkillMap>([
[UnitID.Cannon, new Map([[Skill.ArtilleryRangeIncrease, [2, 8]]])],
[UnitID.HeavyArtillery, new Map([[Skill.ArtilleryRangeIncrease, [3, 7]]])],
[UnitID.Artillery, new Map([[Skill.ArtilleryRangeIncrease, [2, 6]]])],
[UnitID.XFighter, new Map([[Skill.XFighterAttackIncrase, [1, 3]]])],
]);

const skillMovementTypeRadiusEffects = new Map<
Expand All @@ -565,6 +600,7 @@ const skillMovementTypeRadiusEffects = new Map<
],
[MovementTypes.HeavySoldier, new Map([[Skill.BuyUnitSuperAPU, 1]])],
[MovementTypes.AirInfantry, new Map([[Skill.DragonSaboteur, 1]])],
[MovementTypes.Amphibious, new Map([[Skill.ShipIncreaseAttackAndRange, 1]])],
]);

const skillMovementTypeRadiusPowerEffects = new Map<
Expand Down Expand Up @@ -594,6 +630,8 @@ const skillMovementTypeRadiusPowerEffects = new Map<
]),
],
[MovementTypes.AirInfantry, new Map([[Skill.VampireHeal, 2]])],
[MovementTypes.Ship, new Map([[Skill.ShipIncreaseAttackAndRange, 2]])],
[MovementTypes.Amphibious, new Map([[Skill.ShipIncreaseAttackAndRange, 2]])],
]);

const unitCosts = new Map<ID, Map<Skill, number>>([
Expand Down Expand Up @@ -1411,12 +1449,14 @@ export function shouldUpgradeUnit(unit: Unit, skill: Skill) {
case Skill.MovementIncreaseGroundUnitDefenseDecrease:
case Skill.NoUnitRestrictions:
case Skill.Sabotage:
case Skill.ShipIncreaseAttackAndRange:
case Skill.UnitAbilitySniperImmediateAction:
case Skill.UnitBattleShipMoveAndAct:
case Skill.UnitInfantryForestAttackAndDefenseIncrease:
case Skill.UnitRailDefenseIncreasePowerAttackIncrease:
case Skill.UnlockPowerStation:
case Skill.VampireHeal:
case Skill.XFighterAttackIncrase:
return false;
default: {
skill satisfies never;
Expand Down
2 changes: 1 addition & 1 deletion athena/info/Unit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2688,7 +2688,7 @@ export const ReconDrone = new UnitInfo(
);

export const XFighter = new UnitInfo(
25,
UnitID.XFighter,
'X-Fighter',
'Amira',
'female',
Expand Down
1 change: 1 addition & 0 deletions athena/info/UnitID.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export default {
Flamethrower: 15,
Saboteur: 16,
AcidBomber: 22,
XFighter: 25,
Medic: 26,
Dinosaur: 36,
SuperTank: 38,
Expand Down
2 changes: 2 additions & 0 deletions dionysus/lib/shouldActivatePower.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ const shouldConsiderUnitRatio = (skill: Skill) => {
case Skill.NoUnitRestrictions:
case Skill.RecoverAirUnits:
case Skill.Sabotage:
case Skill.ShipIncreaseAttackAndRange:
case Skill.SpawnUnitInfernoJetpack:
case Skill.UnitAbilitySniperImmediateAction:
case Skill.UnitBattleShipMoveAndAct:
Expand All @@ -70,6 +71,7 @@ const shouldConsiderUnitRatio = (skill: Skill) => {
case Skill.UnlockPowerStation:
case Skill.UnlockZombie:
case Skill.VampireHeal:
case Skill.XFighterAttackIncrase:
return true;
default: {
skill satisfies never;
Expand Down
6 changes: 6 additions & 0 deletions hera/lib/getSkillBasedPortrait.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
Commander,
Dinosaur,
Dragon,
Frigate,
InfernoJetpack,
Jeep,
Medic,
Expand All @@ -22,6 +23,7 @@ import {
SuperAPU,
SuperTank,
UnitInfo,
XFighter,
Zombie,
} from '@deities/athena/info/Unit.tsx';
import UnknownTypeError from '@deities/hephaestus/UnknownTypeError.tsx';
Expand Down Expand Up @@ -75,6 +77,10 @@ export default function getSkillBasedPortrait(skill: Skill): UnitInfo | null {
return Medic;
case Skill.Jeep:
return Jeep;
case Skill.ShipIncreaseAttackAndRange:
return Frigate;
case Skill.XFighterAttackIncrase:
return XFighter;
case Skill.ArtilleryRangeIncrease:
case Skill.AttackAndDefenseDecreaseEasy:
case Skill.AttackAndDefenseIncreaseHard:
Expand Down
17 changes: 17 additions & 0 deletions hera/lib/getSkillConfigForDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import Repeat from '@iconify-icons/pixelarticons/repeat.js';
import Shield from '@iconify-icons/pixelarticons/shield.js';
import Ship from '@iconify-icons/pixelarticons/ship.js';
import SpeedSlow from '@iconify-icons/pixelarticons/speed-slow.js';
import Ungroup from '@iconify-icons/pixelarticons/ungroup.js';
import Zap from '@iconify-icons/pixelarticons/zap.js';
import { fbt } from 'fbtee';

Expand Down Expand Up @@ -383,6 +384,22 @@ export default function getSkillConfigForDisplay(skill: Skill): SkillConfig {
icon: Seatbelt,
name: fbt('Seatbelts On', 'Skill name'),
};
case Skill.ShipIncreaseAttackAndRange:
return {
alpha: 0.3,
borderStyle: 'up2x',
colors: 'red',
icon: Ship,
name: fbt('Seafarer', 'Skill name'),
};
case Skill.XFighterAttackIncrase:
return {
alpha: 0.5,
borderStyle: 'plus',
colors: 'pink',
icon: Ungroup,
name: fbt("Amira's Ace", 'Skill name'),
};
default: {
skill satisfies never;
throw new UnknownTypeError('getSkillConfig', skill);
Expand Down
2 changes: 1 addition & 1 deletion hera/ui/SkillDescription.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,6 @@ export default memo(function SkillDescription({
tileDefense?.size ? (
<TileTypeStatusEffect effects={tileDefense} type="defense" />
) : null,
unitRange.size ? <UnitRange color={color} range={unitRange} /> : null,
healTypes ? <HealTypes color={color} types={healTypes} /> : null,
cost ? <CostEffect effect={cost} /> : null,
].filter(isPresent);
Expand Down Expand Up @@ -1113,6 +1112,7 @@ export default memo(function SkillDescription({
<List items={effects} />.
</>
) : null,
unitRange.size ? <UnitRange color={color} range={unitRange} /> : null,
isPower && activateOnInvasion ? (
<div className="paragraph">
<span className={typeStyle} style={{ color: getColor(color) }}>
Expand Down

0 comments on commit 078ecbf

Please sign in to comment.