Skip to content

Commit 7ee85db

Browse files
committed
magma camerupt
1 parent 6b9f9c7 commit 7ee85db

File tree

6 files changed

+102
-0
lines changed

6 files changed

+102
-0
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ TODO:
1919
- Make party add/remove easier
2020
- Fix help again
2121
- Attempt to fix memory leak
22+
- Add Pokemon Emojis wherever possible
2223

2324
**Stretch**
2425

src/battle/data/abilities.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,35 @@ const abilitiesToRegister = Object.freeze({
185185
battle.unregisterListener(properties.listenerId);
186186
},
187187
}),
188+
[abilityIdEnum.BURNING_DRAFT]: new Ability({
189+
id: abilityIdEnum.BURNING_DRAFT,
190+
name: "Burning Draft",
191+
description:
192+
"When the user's turn ends, increase the combat readiness of all allies by 10%.",
193+
abilityAdd({ battle, target }) {
194+
return {
195+
listenerId: battle.registerListenerFunction({
196+
eventName: battleEventEnum.TURN_END,
197+
callback: () => {
198+
const allyPokemons = target.getPartyPokemon();
199+
target.battle.addToLog(
200+
`${target.name}'s Burning Draft increases its allies' combat readiness!`
201+
);
202+
allyPokemons.forEach((ally) => {
203+
if (!ally) {
204+
return;
205+
}
206+
ally.boostCombatReadiness(target, 10);
207+
});
208+
},
209+
conditionCallback: getIsActivePokemonCallback(battle, target),
210+
}),
211+
};
212+
},
213+
abilityRemove({ battle, properties }) {
214+
battle.unregisterListener(properties.listenerId);
215+
},
216+
}),
188217
});
189218

190219
module.exports = {

src/battle/data/moves.js

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const {
99
} = require("../../config/battleConfig");
1010
const { getMove } = require("./moveRegistry");
1111
const { moveIdEnum } = require("../../enums/battleEnums");
12+
const { drawIterable } = require("../../utils/gachaUtils");
1213

1314
class Move {
1415
/**
@@ -307,6 +308,54 @@ const movesToRegister = Object.freeze({
307308
});
308309
},
309310
}),
311+
[moveIdEnum.FLAME_BALL]: new Move({
312+
id: moveIdEnum.FLAME_BALL,
313+
name: "Flame Ball",
314+
type: pokemonTypes.FIRE,
315+
power: 60,
316+
accuracy: 90,
317+
cooldown: 3,
318+
targetType: targetTypes.ENEMY,
319+
targetPosition: targetPositions.FRONT,
320+
targetPattern: targetPatterns.SQUARE,
321+
tier: moveTiers.POWER,
322+
damageType: damageTypes.PHYSICAL,
323+
description:
324+
"The user strikes the targets with an exploding fiery ball, heating up its allies. For each hit, boosts the combat readiness of a random Fire or Ground type ally by 15%.",
325+
execute({ battle, source, primaryTarget, allTargets, missedTargets }) {
326+
this.genericDealAllDamage({
327+
source,
328+
primaryTarget,
329+
allTargets,
330+
missedTargets,
331+
});
332+
333+
const sourceTeamPokemons = source.getPartyPokemon();
334+
const fireGroundAllies = sourceTeamPokemons.filter(
335+
(pokemon) =>
336+
pokemon !== source &&
337+
pokemon &&
338+
!pokemon.isFainted &&
339+
(pokemon.hasType(pokemonTypes.FIRE) ||
340+
pokemon.hasType(pokemonTypes.GROUND))
341+
);
342+
if (fireGroundAllies.length === 0) {
343+
return;
344+
}
345+
const [randomAlly] = drawIterable(fireGroundAllies, 1);
346+
const hitCount = allTargets.reduce(
347+
(count, target) =>
348+
!missedTargets.includes(target) ? count + 1 : count,
349+
0
350+
);
351+
if (hitCount > 0) {
352+
battle.addToLog(
353+
`${randomAlly.name} is burning up from the Flame Ball!`
354+
);
355+
randomAlly.boostCombatReadiness(source, hitCount * 15);
356+
}
357+
},
358+
}),
310359
});
311360

312361
module.exports = {

src/config/pokemonConfig.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6477,6 +6477,26 @@ const pokemonConfigRaw = {
64776477
rarity: rarities.EPIC,
64786478
growthRate: growthRates.MEDIUMFAST,
64796479
},
6480+
[pokemonIdEnum.MAGMAS_CAMERUPT]: {
6481+
name: "Magma's Camerupt",
6482+
emoji: "<:magmacamerupt:1325287155198722160>",
6483+
description:
6484+
"A Camerupt controlled by Team Magma. It is said to be able to cause volcanic eruptions with a single stomp.",
6485+
type: [types.FIRE, types.GROUND],
6486+
baseStats: [70, 135, 90, 90, 95, 70],
6487+
sprite:
6488+
"https://raw.githubusercontent.com/ewei068/pokestar/main/media/images/sprites/magma-camerupt-resized.gif",
6489+
shinySprite:
6490+
"https://raw.githubusercontent.com/ewei068/pokestar/main/media/images/sprites/magma-camerupt-shiny-resized.gif",
6491+
abilities: {
6492+
[abilityIdEnum.BURNING_DRAFT]: 1,
6493+
},
6494+
moveIds: ["m98", "m523", moveIdEnum.FLAME_BALL, "m157"],
6495+
battleEligible: true,
6496+
rarity: rarities.EPIC,
6497+
growthRate: growthRates.MEDIUMFAST,
6498+
noGacha: true,
6499+
},
64806500
324: {
64816501
name: "Torkoal",
64826502
emoji: "<:324:1132496594567188584>",

src/enums/battleEnums.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ const moveIdEnum = Object.freeze({
2323
VINE_WHIP: "m22",
2424
AQUA_IMPACT: "m618-1",
2525
MAGMA_IMPACT: "m619-1",
26+
FLAME_BALL: "m780-1",
2627
});
2728

2829
/**
@@ -36,6 +37,7 @@ const abilityIdEnum = Object.freeze({
3637
MAGMA_POWER: "70-1",
3738
ANGER_POINT: "83",
3839
REGENERATOR: "144",
40+
BURNING_DRAFT: "20018",
3941
});
4042

4143
/** @typedef {Enum<battleEventEnum>} BattleEventEnum */

src/enums/pokemonEnums.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ const pokemonIdEnum = Object.freeze({
234234
WAILORD: "321",
235235
NUMEL: "322",
236236
CAMERUPT: "323",
237+
MAGMAS_CAMERUPT: "323-1",
237238
TORKOAL: "324",
238239
TRAPINCH: "328",
239240
VIBRAVA: "329",

0 commit comments

Comments
 (0)