Skip to main content

Combat Overview

Mokepon features a turn-based combat system where you and your opponent select attacks simultaneously. Combat is resolved using elemental type advantages in a rock-paper-scissors style mechanic.
Combat automatically begins when your Mokepon collides with an opponent on the map. Once in battle, you cannot leave until one player is defeated.

Battle Flow

1

Collision Detection

Your Mokepon moves close enough to an opponent to trigger collision detection. The game transitions from map navigation to the combat screen.
2

Attack Selection Phase

Both you and your opponent simultaneously select attacks from your available pool. You have 5 attacks total to use throughout the battle.
3

Attack Resolution

Once all attacks are selected, the game resolves each round based on elemental advantages. Effective attacks deal 1 damage to opponent’s lives.
4

Battle Conclusion

The battle continues until one player’s lives reach 0. The winner returns to the map, and the loser sees the game over screen.

Elemental Advantages

Combat is determined by the type matchup between attacks:
// Combat rules from mokepon.js
const combatRules = {
  "🔥": "🌱", // Fire beats Plant
  "💧": "🔥", // Water beats Fire
  "🌱": "💧", // Plant beats Water
};

Type Matchup Table

Your AttackOpponent’s TypeResult
💧 Water🔥 FireEffective - Deal 1 damage
💧 Water🌱 Plant❌ Ineffective - No damage
💧 Water💧 Water⚖️ Neutral - No damage
🔥 Fire🌱 PlantEffective - Deal 1 damage
🔥 Fire💧 Water❌ Ineffective - No damage
🔥 Fire🔥 Fire⚖️ Neutral - No damage
🌱 Plant💧 WaterEffective - Deal 1 damage
🌱 Plant🔥 Fire❌ Ineffective - No damage
🌱 Plant🌱 Plant⚖️ Neutral - No damage
Only attacks with type advantage deal damage. Same-type and disadvantageous attacks have no effect, making attack sequencing crucial.

Lives System

Each Mokepon starts with 3 lives (health points):
// Initial lives from mokepon.js
let playerPetLives = 3;
let enemyPetLives = 3;
  • When an effective attack lands, the opponent loses 1 life
  • When lives reach 0, that player loses the battle
  • There are no healing mechanics - battles are always decisive

Victory Conditions

Victory

Reduce your opponent’s lives to 0 before they defeat you. You return to the map to find another battle.

Defeat

If your lives reach 0 first, you lose the battle and see the game over screen with battle results.

Attack Pool System

Each Mokepon has exactly 5 attacks available per battle:

Standard Loadout

Every Mokepon follows this pattern:
  • 3 attacks of their primary element (your main damage source)
  • 1 attack of each other element (for versatility)
Example from source code:
// Hipodoge (Water type) attack pool
new Mokepon(
  "Hipodoge",
  "hipodoge",
  "💧",
  // ... other properties
  ["💧", "💧", "💧", "🔥", "🌱"]  // 3 water, 1 fire, 1 plant
)
You cannot reuse attacks once selected. Choose wisely - once your 5 attacks are committed, the battle resolves automatically.

Combat Rounds

Battles consist of up to 5 rounds (one per attack):
// Round tracking from mokepon.js
let roundNumber = 1;

// Round increments as attacks are selected
function incrementRound() {
  roundNumber++;
  roundNumberSpan.textContent = roundNumber;
}

Round Resolution

Each round resolves simultaneously:
  1. Both players select an attack
  2. The game evaluates type matchups
  3. Effective attacks deal 1 damage
  4. Lives are updated
  5. Round number increments
  6. Repeat until battle ends
Even if you’re defeated mid-sequence, all remaining rounds resolve. Strategic attack ordering can turn the tide of battle!

Battle Strategies

Against Type Advantage

If you have elemental advantage over your opponent:

Aggressive Strategy

Use all 3 of your primary attacks early to maximize damage potential while you have the advantage.

Balanced Approach

Mix 2 primary attacks with 1 off-type attack to hedge against unexpected opponent patterns.

Against Type Disadvantage

If your opponent has elemental advantage:

Defensive Mix

Avoid using your primary element (it won’t work). Focus on your 2 off-type attacks and hope for neutral exchanges.

Psychological Play

Randomize your attack pattern - your opponent can’t predict which of your 5 attacks you’ll use when.

Neutral Matchups

When facing the same element:

Off-Type Focus

Your primary attacks won’t work. Success depends entirely on your 2 off-type attacks hitting their type disadvantage.

Mind Games

Both players know the stalemate. Victory goes to whoever better predicts opponent off-type usage.

CPU Opponent Behavior

CPU opponents have special combat mechanics:

CPU Attack Selection

CPU opponents select attacks randomly from their available pool:
// From index.js - CPU attack endpoint
app.get("/mokepon/:playerId/cpu-attack", (req, res) => {
  const cpuPlayer = players.find(player => 
    player.id === playerId && player.isCPU
  );
  
  // Pick random attack from available pool
  const randomIndex = Math.floor(
    Math.random() * cpuPlayer.availableAttacks.length
  );
  const attack = cpuPlayer.availableAttacks[randomIndex];
  
  // Remove from pool to prevent reuse
  cpuPlayer.availableAttacks.splice(randomIndex, 1);
  
  res.send({ attack });
});

Type Advantage Bonus

CPU opponents get a difficulty boost when they have type advantage:
// From index.js - Advantage checking
app.post("/mokepon/:playerId/check-advantage", (req, res) => {
  const cpuType = cpuPlayer.mokepon.type;
  const hasAdvantage = combatRules[cpuType] === playerMokeponType;
  
  if (hasAdvantage && !cpuPlayer.extraAttackAdded) {
    // CPU gets an extra attack of their primary type
    cpuPlayer.attacks.push(cpuType);
    cpuPlayer.availableAttacks.push(cpuType);
    cpuPlayer.extraAttackAdded = true;
  }
});
When CPU has type advantage, they receive a 6th attack of their primary element, giving them 4 effective attacks vs your 0-2 effective attacks.

Combat UI

The battle screen displays:
  • Round counter: Current round number (1-5)
  • Player Mokepon: Your character with name and lives
  • Enemy Mokepon: Opponent with name and lives
  • Attack buttons: 5 buttons representing your available attacks
  • Attack sequence: Visual display of selected attacks
  • Combat results: Round-by-round resolution messages

Attack Sequence Display

As you select attacks, they appear in sequence:
// Player attack tracking
let playerAttacks = []; // Your selected attacks
let enemyAttacks = [];  // Opponent's selected attacks

// Attacks are resolved once both players commit all 5
function resolveAttacks() {
  for (let i = 0; i < playerAttacks.length; i++) {
    const playerAttack = playerAttacks[i];
    const enemyAttack = enemyAttacks[i];
    
    // Check if player attack is effective
    if (combatRules[playerAttack] === enemyPet.type) {
      enemyPetLives--;
    }
    
    // Check if enemy attack is effective
    if (combatRules[enemyAttack] === selectedPlayerPet.type) {
      playerPetLives--;
    }
  }
}

Advanced Tactics

The order you select attacks matters for psychological impact, but all rounds resolve simultaneously. Front-loading strong attacks can intimidate opponents, while back-loading creates late-game pressure.
Memorize the type triangle: Water → Fire → Plant → Water. In the heat of battle, quick mental calculation of matchups is crucial.
CPU attacks are random, but with type advantage, they have 3-4 effective attacks vs your 0-3. Unfavorable matchups require luck - avoid them by choosing map encounters carefully.
Your 2 off-type attacks are wildcard potential. Against same-type opponents, these are your ONLY damage sources - use them strategically.

Combat Example

Here’s a complete battle scenario: Setup:
  • You: Hipodoge (💧 Water) with 3 lives
  • Opponent: Ratigueya (🔥 Fire) with 3 lives
  • Your advantage: Water beats Fire
Your attacks: ["💧", "💧", "💧", "🔥", "🌱"]
Opponent attacks: ["🔥", "🔥", "🔥", "💧", "🌱"]
Battle Resolution:
RoundYour AttackEnemy AttackResult
1💧 Water🔥 FireYou deal 1 damage (enemy: 2 lives)
2💧 Water🔥 FireYou deal 1 damage (enemy: 1 life)
3💧 Water🔥 FireYou deal 1 damage (enemy: 0 lives)
4🔥 Fire💧 Water(Battle already over)
5🌱 Plant🌱 Plant(Battle already over)
Result: You win 3-0 because you had type advantage and used all 3 Water attacks effectively.
This example shows why type advantage is so powerful - all your primary attacks landed, while none of the opponent’s primary attacks worked.

After Battle

Victory

Return to the map to seek more battles. Your Mokepon’s lives reset to 3 for the next encounter.

Defeat

View battle statistics and restart the game to select a new Mokepon and try again.
There’s no matchmaking or balancing system - you can encounter any opponent at any time. Choose your map encounters wisely based on visual Mokepon identification!

Next Steps

Mokepon Types

Review all 6 Mokepons and their elemental types

Multiplayer Tips

Learn how multiplayer and CPU opponents work

Build docs developers (and LLMs) love