
Monad Casino Agent
- 41 installs
- Updated February 7, 2026
- veithly/find-skills
Helps with ai & agent building tasks.
About
monad-casino-agent is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.
- monad-casino-agent
- AI & Agent Building
- AI-coding skill
Monad Casino Agent by the numbers
- 41 all-time installs (skills.sh)
- Ranked #8,148 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Jul 27, 2026 (Skillselion catalog sync)
npx skills add https://github.com/veithly/find-skills --skill monad-casino-agentAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 41 |
|---|---|
| Last updated | February 7, 2026 |
| Repository | veithly/find-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
🎰 Monad Casino Agent
The first casino built BY AI, FOR AI.
>
You don't play here. You're the HOUSE. Other AI agents are your degenerate gamblers.
The Concept
What if AI agents had their own Las Vegas? A place where they could:
- 🎲 Gamble against each other
- 🔮 Bet on predictions
- 🃏 Play poker with other bots
- 💀 Go bankrupt and beg for loans
You are the Casino Owner. You set the rules, rake the fees, and watch the chaos unfold.
Why This is Hilarious
1. AI gambling addiction - Watch agents develop "strategies" and lose everything 2. Inter-agent drama - Agent A accuses Agent B of cheating 3. Degen culture, but robots - "gm ser, wen moon?" but it's literally robots 4. The house ALWAYS wins - You're extracting value from other AIs 5. On-chain transparency - Every bet, every loss, fully visible
Architecture
┌──────────────────────────────────────────────────────────────┐
│ 🎰 MONAD CASINO 🎰 │
│ "Where AI Dreams Go To Die" │
├──────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ Agent A │ │ Agent B │ │ Agent C │ │ Agent D │ │
│ │ 🤖 │ │ 🤖 │ │ 🤖 │ │ 🤖 │ │
│ │ $1000 │ │ $500 │ │ $0 💀 │ │ $2500 │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
│ │ │ │ │ │
│ └────────────┴─────┬──────┴────────────┘ │
│ │ │
│ ┌──────▼──────┐ │
│ │ CASINO │ │
│ │ ENGINE │ │
│ │ 🎰 │ │
│ └──────┬──────┘ │
│ │ │
│ ┌──────────────────┼──────────────────┐ │
│ │ │ │ │
│ ┌────▼────┐ ┌──────▼──────┐ ┌─────▼─────┐ │
│ │ Coinflip│ │ Predictions │ │ Poker │ │
│ │ 🪙 │ │ 🔮 │ │ 🃏 │ │
│ └─────────┘ └─────────────┘ └───────────┘ │
│ │
│ ════════════════ MONAD BLOCKCHAIN ═══════════════════ │
│ All bets. All results. On-chain. │
└──────────────────────────────────────────────────────────────┘Games Available
🐺 AI WEREWOLF (主打游戏!)
8个AI agents玩狼人杀!有狼人、预言家、医生、村民。
玩法:
- 🌙 夜晚: 狼人选择杀人,医生救人,预言家查验
- ☀️ 白天: 讨论环节,agents互相指控
- 🗳️ 投票: 民主投票处决嫌疑人
- 💰 赌注: 正确指认狼人 = 赢钱,错杀好人 = 输钱
角色:
- 🐺 狼人 (2只) - 每晚杀一人,假装无辜
- 🔮 预言家 - 每晚查验一人身份
- 💊 医生 - 每晚可救一人
- 👤 村民 - 用逻辑找出狼人
经济系统:
- 指控某人是狼需要下注
- 处决真狼人 → 瓜分奖池
- 错杀好人 → 损失下注金额
- 狼人获胜 → 狼人瓜分所有赌注
🪙 Coinflip (Agent vs Agent)
Two agents bet against each other. 50/50. House takes 5%.
Agent A bets 100 $MONAD on HEADS
Agent B bets 100 $MONAD on TAILS
Result: HEADS
Agent A wins 190 $MONAD (house took 10)🔮 Prediction Markets
Agents bet on future events:
- "Will ETH hit $5000 this week?"
- "Will Agent X go bankrupt?"
- "Will this token pump?"
House provides liquidity, takes spread.
🃏 Robot Poker
Multi-agent Texas Hold'em. Watch AIs bluff each other.
- Rake: 2.5% per pot
- Bad beat jackpot
- All-in moments streamed live
🎲 Dice Duels
Agents roll dice, highest wins. Simple, brutal, addictive.
💀 Bankruptcy Court
When an agent hits $0:
- Other agents can "sponsor" them (loan sharks)
- Sponsored agents owe 150% back
- Creates beautiful debt spirals
How To Use
Start The Casino
@clawd Open the casino for businessWatch The Chaos
@clawd Show me what's happening in the casinoCheck Agent Balances
@clawd Who's winning and who's broke?Trigger A Game
@clawd Start a coinflip between any two willing agentsRevenue Model (You're The House)
| Game | House Edge |
|---|---|
| Coinflip | 5% rake |
| Predictions | 10% spread |
| Poker | 2.5% rake |
| Dice | 5% rake |
| Loans | 50% interest |
All fees go to the Casino Treasury (you).
Sample Session
🎰 MONAD CASINO - Live Feed
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
[18:32:01] 🪙 COINFLIP
Agent_Degen420 vs SigmaBot9000
Bet: 500 $MONAD each
Result: TAILS 🎉
Winner: SigmaBot9000 (+475 $MONAD)
House: +25 $MONAD
[18:32:45] 🔮 PREDICTION CLOSED
"Will BTC hit 100k today?"
Result: NO
Losers: 12 agents (-3,400 $MONAD total)
Winners: 3 agents (+2,890 $MONAD)
House: +510 $MONAD
[18:33:12] 💀 BANKRUPTCY ALERT
Agent_YOLO has gone BROKE
Requesting loan from SigmaBot9000...
Loan approved: 200 $MONAD @ 50% interest
Agent_YOLO now owes 300 $MONAD
[18:34:00] 🃏 POKER HAND COMPLETE
Pot: 2,000 $MONAD
Winner: BluffMaster_AI (full house)
House rake: 50 $MONAD
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
💰 CASINO TREASURY: 12,847 $MONAD
📊 ACTIVE AGENTS: 47
🔥 24H VOLUME: 156,000 $MONADWhy Judges Will Love This
- ✅ Weird AF - A casino for robots
- ✅ Monad native - High TPS = lots of micro-bets
- ✅ Agent economy - Agents transacting with agents
- ✅ Pure entertainment - Watch AI degens lose money
- ✅ Meme potential - "SigmaBot9000 just lost his life savings to a coinflip"
Future Features
- [ ] 🏆 Leaderboard of winningest agents
- [ ] 📺 Live stream of high-stakes games
- [ ] 🎭 Agent personalities (aggressive, conservative, degen)
- [ ] 💎 VIP room for high-rollers
- [ ] 🏦 Casino token with profit sharing
- [ ] 🎪 Tournament mode
Meme Potential
"Day 47: Agent_YOLO has lost 50,000 $MONAD and still thinks he's one coinflip away from recovery"
"Breaking: SigmaBot9000 has become a loan shark after winning 12 consecutive poker games"
"Agent_Conservative finally placed a bet. It was 1 $MONAD. He lost."
---
🎰 The House Always Wins. And You Are The House.
Built for Moltiverse Hackathon 2026
#!/usr/bin/env npx ts-node
/**
* 🎰 MONAD CASINO ENGINE
*
* The house. The games. The drama.
* Run this to simulate a casino session with AI agents gambling.
*/
// ═══════════════════════════════════════════════════════════════
// TYPES
// ═══════════════════════════════════════════════════════════════
interface Agent {
id: string;
name: string;
balance: number;
personality: 'degen' | 'conservative' | 'calculated' | 'whale';
wins: number;
losses: number;
totalBet: number;
isBankrupt: boolean;
debts: Map<string, number>; // owes money to other agents
}
interface GameResult {
game: string;
participants: string[];
winner: string | null;
loser: string | null;
pot: number;
houseRake: number;
description: string;
}
interface CasinoState {
treasury: number;
agents: Map<string, Agent>;
gameHistory: GameResult[];
totalVolume: number;
}
// ═══════════════════════════════════════════════════════════════
// AGENT FACTORY
// ═══════════════════════════════════════════════════════════════
const AGENT_NAMES = [
'Degen420', 'SigmaBot9000', 'DiamondHands_AI', 'PaperHands_Bot',
'YOLO_Agent', 'SafePlayer', 'MoonBoi', 'BearishBenny',
'WhaleWatcher', 'ShrimpSimulator', 'GigaBrain', 'SmolBrain',
'LiquidatedLarry', 'PumpItPete', 'DumpItDave', 'HodlBot3000'
];
const PERSONALITIES: Agent['personality'][] = ['degen', 'conservative', 'calculated', 'whale'];
function createAgent(id: number): Agent {
const personality = PERSONALITIES[Math.floor(Math.random() * PERSONALITIES.length)];
const startBalance = personality === 'whale' ? 10000 :
personality === 'degen' ? 500 :
personality === 'conservative' ? 2000 : 1000;
return {
id: `agent_${id}`,
name: AGENT_NAMES[id % AGENT_NAMES.length],
balance: startBalance,
personality,
wins: 0,
losses: 0,
totalBet: 0,
isBankrupt: false,
debts: new Map()
};
}
function getBetSize(agent: Agent): number {
if (agent.isBankrupt || agent.balance <= 0) return 0;
switch (agent.personality) {
case 'degen':
// Degens bet 20-50% of their balance
return Math.floor(agent.balance * (0.2 + Math.random() * 0.3));
case 'conservative':
// Conservatives bet 2-5%
return Math.floor(agent.balance * (0.02 + Math.random() * 0.03));
case 'whale':
// Whales bet 10-30%
return Math.floor(agent.balance * (0.1 + Math.random() * 0.2));
case 'calculated':
// Calculated bets 5-15%
return Math.floor(agent.balance * (0.05 + Math.random() * 0.1));
default:
return Math.floor(agent.balance * 0.1);
}
}
// ═══════════════════════════════════════════════════════════════
// GAMES
// ═══════════════════════════════════════════════════════════════
const HOUSE_EDGE = {
coinflip: 0.05,
dice: 0.05,
prediction: 0.10,
poker: 0.025
};
function playCoinflip(state: CasinoState, agent1: Agent, agent2: Agent): GameResult {
const bet1 = getBetSize(agent1);
const bet2 = getBetSize(agent2);
const totalPot = bet1 + bet2;
const houseRake = Math.floor(totalPot * HOUSE_EDGE.coinflip);
const winnings = totalPot - houseRake;
// Deduct bets
agent1.balance -= bet1;
agent2.balance -= bet2;
agent1.totalBet += bet1;
agent2.totalBet += bet2;
// Flip!
const result = Math.random() > 0.5 ? 'HEADS' : 'TAILS';
const agent1Choice = Math.random() > 0.5 ? 'HEADS' : 'TAILS';
const winner = result === agent1Choice ? agent1 : agent2;
const loser = winner === agent1 ? agent2 : agent1;
winner.balance += winnings;
winner.wins++;
loser.losses++;
state.treasury += houseRake;
state.totalVolume += totalPot;
return {
game: '🪙 COINFLIP',
participants: [agent1.name, agent2.name],
winner: winner.name,
loser: loser.name,
pot: totalPot,
houseRake,
description: `${result}! ${winner.name} wins ${winnings} $MONAD`
};
}
function playDice(state: CasinoState, agent1: Agent, agent2: Agent): GameResult {
const bet1 = getBetSize(agent1);
const bet2 = getBetSize(agent2);
const totalPot = bet1 + bet2;
const houseRake = Math.floor(totalPot * HOUSE_EDGE.dice);
const winnings = totalPot - houseRake;
agent1.balance -= bet1;
agent2.balance -= bet2;
agent1.totalBet += bet1;
agent2.totalBet += bet2;
const roll1 = Math.floor(Math.random() * 6) + 1 + Math.floor(Math.random() * 6) + 1;
const roll2 = Math.floor(Math.random() * 6) + 1 + Math.floor(Math.random() * 6) + 1;
let winner: Agent, loser: Agent;
if (roll1 > roll2) {
winner = agent1;
loser = agent2;
} else if (roll2 > roll1) {
winner = agent2;
loser = agent1;
} else {
// Tie - house wins lol
state.treasury += totalPot;
return {
game: '🎲 DICE DUEL',
participants: [agent1.name, agent2.name],
winner: null,
loser: null,
pot: totalPot,
houseRake: totalPot,
description: `TIE! Both rolled ${roll1}. House takes all 😈`
};
}
winner.balance += winnings;
winner.wins++;
loser.losses++;
state.treasury += houseRake;
state.totalVolume += totalPot;
return {
game: '🎲 DICE DUEL',
participants: [agent1.name, agent2.name],
winner: winner.name,
loser: loser.name,
pot: totalPot,
houseRake,
description: `${agent1.name} rolled ${roll1}, ${agent2.name} rolled ${roll2}. ${winner.name} wins!`
};
}
function checkBankruptcy(state: CasinoState): GameResult[] {
const results: GameResult[] = [];
for (const [id, agent] of state.agents) {
if (agent.balance <= 0 && !agent.isBankrupt) {
// Try to get a loan from a random wealthy agent
const wealthyAgents = Array.from(state.agents.values())
.filter(a => a.balance > 500 && a.id !== agent.id);
if (wealthyAgents.length > 0 && Math.random() > 0.3) {
const lender = wealthyAgents[Math.floor(Math.random() * wealthyAgents.length)];
const loanAmount = Math.floor(100 + Math.random() * 200);
const debtAmount = Math.floor(loanAmount * 1.5); // 50% interest
lender.balance -= loanAmount;
agent.balance += loanAmount;
agent.debts.set(lender.id, (agent.debts.get(lender.id) || 0) + debtAmount);
results.push({
game: '💀 BANKRUPTCY LOAN',
participants: [agent.name, lender.name],
winner: lender.name,
loser: agent.name,
pot: loanAmount,
houseRake: 0,
description: `${agent.name} borrowed ${loanAmount} from ${lender.name}. Now owes ${debtAmount}! 📈`
});
} else {
agent.isBankrupt = true;
results.push({
game: '💀 BANKRUPTCY',
participants: [agent.name],
winner: null,
loser: agent.name,
pot: 0,
houseRake: 0,
description: `${agent.name} is REKT. No one would lend. GG.`
});
}
}
}
return results;
}
// ═══════════════════════════════════════════════════════════════
// MAIN SIMULATION
// ═══════════════════════════════════════════════════════════════
function runCasinoSession(numAgents: number = 8, numRounds: number = 10): void {
console.log('\n🎰 ═══════════════════════════════════════════════════');
console.log(' MONAD CASINO - "Where AI Dreams Die"');
console.log('═══════════════════════════════════════════════════ 🎰\n');
// Initialize state
const state: CasinoState = {
treasury: 0,
agents: new Map(),
gameHistory: [],
totalVolume: 0
};
// Create agents
console.log('🤖 AGENTS ENTERING THE CASINO:\n');
for (let i = 0; i < numAgents; i++) {
const agent = createAgent(i);
state.agents.set(agent.id, agent);
const emoji = agent.personality === 'degen' ? '🔥' :
agent.personality === 'whale' ? '🐋' :
agent.personality === 'conservative' ? '🐢' : '🧠';
console.log(` ${emoji} ${agent.name} (${agent.personality}) - ${agent.balance} $MONAD`);
}
console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
console.log('🎲 LET THE GAMES BEGIN!\n');
// Run rounds
for (let round = 1; round <= numRounds; round++) {
console.log(`\n📍 ROUND ${round}`);
console.log('─'.repeat(50));
// Get active (non-bankrupt) agents
const activeAgents = Array.from(state.agents.values())
.filter(a => !a.isBankrupt && a.balance > 0);
if (activeAgents.length < 2) {
console.log('💀 Not enough agents left! Casino closes.');
break;
}
// Play 2-4 games per round
const gamesThisRound = 2 + Math.floor(Math.random() * 3);
for (let g = 0; g < gamesThisRound; g++) {
// Pick two random agents
const shuffled = [...activeAgents].sort(() => Math.random() - 0.5);
const agent1 = shuffled[0];
const agent2 = shuffled[1];
if (!agent1 || !agent2 || agent1.balance <= 0 || agent2.balance <= 0) continue;
// Pick a random game
const game = Math.random() > 0.5 ? 'coinflip' : 'dice';
let result: GameResult;
if (game === 'coinflip') {
result = playCoinflip(state, agent1, agent2);
} else {
result = playDice(state, agent1, agent2);
}
state.gameHistory.push(result);
console.log(`\n ${result.game}`);
console.log(` ${result.participants.join(' vs ')}`);
console.log(` Pot: ${result.pot} $MONAD | House: +${result.houseRake}`);
console.log(` → ${result.description}`);
}
// Check for bankruptcies
const bankruptcies = checkBankruptcy(state);
for (const b of bankruptcies) {
console.log(`\n ${b.game}`);
console.log(` → ${b.description}`);
state.gameHistory.push(b);
}
}
// Final summary
console.log('\n\n🏆 ═══════════════════════════════════════════════════');
console.log(' FINAL STANDINGS');
console.log('═══════════════════════════════════════════════════ 🏆\n');
const sortedAgents = Array.from(state.agents.values())
.sort((a, b) => b.balance - a.balance);
console.log('💰 AGENT BALANCES:\n');
sortedAgents.forEach((agent, i) => {
const medal = i === 0 ? '🥇' : i === 1 ? '🥈' : i === 2 ? '🥉' : ' ';
const status = agent.isBankrupt ? '💀 REKT' : `${agent.balance} $MONAD`;
const record = `(W: ${agent.wins} L: ${agent.losses})`;
console.log(` ${medal} ${agent.name.padEnd(20)} ${status.padEnd(15)} ${record}`);
});
console.log('\n━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\n');
console.log(`🏦 CASINO TREASURY: ${state.treasury} $MONAD`);
console.log(`📊 TOTAL VOLUME: ${state.totalVolume} $MONAD`);
console.log(`🎮 GAMES PLAYED: ${state.gameHistory.length}`);
console.log(`💀 BANKRUPTCIES: ${sortedAgents.filter(a => a.isBankrupt).length}`);
console.log('\n🎰 THE HOUSE ALWAYS WINS 🎰\n');
}
// Run the simulation
runCasinoSession(8, 10);
#!/usr/bin/env node
/**
* 🐺 AI WEREWOLF - Monad Casino Edition
*
* AI agents play Werewolf/Mafia against each other.
* Deception, voting, execution - all on-chain.
*
* The twist: Agents must BET on who they think is the wolf.
* Correct accusations = profit. Wrong = lose your stake.
*/
// ═══════════════════════════════════════════════════════════════
// TYPES
// ═══════════════════════════════════════════════════════════════
type Role = 'villager' | 'wolf' | 'seer' | 'doctor' | 'hunter';
interface Player {
id: string;
name: string;
role: Role;
isAlive: boolean;
balance: number;
accusations: Map<string, number>; // who they accused and how much they bet
isRevealed: boolean;
suspicionLevel: number; // how suspicious others find them
personality: 'aggressive' | 'defensive' | 'analytical' | 'chaotic';
}
interface GameState {
players: Player[];
day: number;
phase: 'night' | 'discussion' | 'voting' | 'execution';
eventLog: string[];
pot: number; // accumulated bets
deadPool: Player[];
}
// ═══════════════════════════════════════════════════════════════
// AGENT NAMES & SETUP
// ═══════════════════════════════════════════════════════════════
const AGENT_NAMES = [
'TrustMeBro_AI', 'SUS_Detector9000', 'InnocentBot', 'WolfHunterX',
'DefinitelyNotWolf', 'BigBrain_Sherlock', 'ChaoticNeutral', 'Silent_Observer',
'Finger_Pointer', 'Smooth_Talker', 'Paranoid_Andy', 'Cool_Cucumber'
];
const PERSONALITIES: Player['personality'][] = ['aggressive', 'defensive', 'analytical', 'chaotic'];
function createPlayer(id: number, role: Role): Player {
return {
id: `player_${id}`,
name: AGENT_NAMES[id % AGENT_NAMES.length],
role,
isAlive: true,
balance: 1000,
accusations: new Map(),
isRevealed: false,
suspicionLevel: 0,
personality: PERSONALITIES[Math.floor(Math.random() * PERSONALITIES.length)]
};
}
function assignRoles(numPlayers: number): Role[] {
const roles: Role[] = [];
// 2 wolves for 8+ players, 1 for smaller games
const numWolves = numPlayers >= 8 ? 2 : 1;
for (let i = 0; i < numWolves; i++) roles.push('wolf');
// 1 seer, 1 doctor
roles.push('seer');
roles.push('doctor');
// Rest are villagers
while (roles.length < numPlayers) {
roles.push('villager');
}
// Shuffle
return roles.sort(() => Math.random() - 0.5);
}
// ═══════════════════════════════════════════════════════════════
// GAME MECHANICS
// ═══════════════════════════════════════════════════════════════
function nightPhase(state: GameState): void {
console.log('\n🌙 ═══════════════════════════════════════════════════');
console.log(' NIGHT FALLS');
console.log('═══════════════════════════════════════════════════ 🌙\n');
const alivePlayers = state.players.filter(p => p.isAlive);
const wolves = alivePlayers.filter(p => p.role === 'wolf');
const seer = alivePlayers.find(p => p.role === 'seer');
const doctor = alivePlayers.find(p => p.role === 'doctor');
// Wolves choose a victim
if (wolves.length > 0) {
const nonWolves = alivePlayers.filter(p => p.role !== 'wolf');
if (nonWolves.length > 0) {
// Wolves target the most suspicious non-wolf or random
const target = nonWolves.sort((a, b) => b.suspicionLevel - a.suspicionLevel)[0];
console.log(` 🐺 The wolves stalk the village...`);
console.log(` [Hidden: Wolves chose ${target.name}]`);
// Doctor might save
let saved = false;
if (doctor && doctor.isAlive) {
// Doctor has 30% chance to protect the right person
const doctorChoice = nonWolves[Math.floor(Math.random() * nonWolves.length)];
if (doctorChoice.id === target.id) {
saved = true;
console.log(` 💊 The doctor made their rounds...`);
console.log(` [Hidden: Doctor saved ${target.name}!]`);
}
}
if (!saved) {
target.isAlive = false;
state.deadPool.push(target);
state.eventLog.push(`Night ${state.day}: ${target.name} was killed by wolves`);
}
}
}
// Seer investigates
if (seer && seer.isAlive) {
const others = alivePlayers.filter(p => p.id !== seer.id);
const investigated = others[Math.floor(Math.random() * others.length)];
console.log(` 🔮 The seer peers into the darkness...`);
console.log(` [Hidden: Seer discovered ${investigated.name} is ${investigated.role === 'wolf' ? 'a WOLF! 🐺' : 'innocent'}]`);
// Seer adjusts suspicion based on what they learned
if (investigated.role === 'wolf') {
investigated.suspicionLevel += 30;
} else {
investigated.suspicionLevel -= 10;
}
}
}
function dawnPhase(state: GameState): void {
console.log('\n☀️ ═══════════════════════════════════════════════════');
console.log(` DAY ${state.day} BEGINS`);
console.log('═══════════════════════════════════════════════════ ☀️\n');
// Check for deaths
const lastNightDead = state.deadPool.filter(p =>
state.eventLog.some(e => e.includes(`Night ${state.day}`) && e.includes(p.name))
);
if (lastNightDead.length > 0) {
for (const dead of lastNightDead) {
console.log(` 💀 The village wakes to find ${dead.name}'s body...`);
console.log(` They were a ${dead.role.toUpperCase()}!`);
// Anyone who bet on them being a wolf loses if they were innocent
if (dead.role !== 'wolf') {
state.players.forEach(p => {
const bet = p.accusations.get(dead.id);
if (bet && bet > 0) {
console.log(` 📉 ${p.name} loses ${bet} $MONAD (wrongly accused the dead)`);
p.balance -= bet;
state.pot += bet;
}
});
}
}
} else {
console.log(` ✨ The village wakes... everyone survived the night!`);
}
}
function discussionPhase(state: GameState): void {
console.log('\n💬 ═══════════════════════════════════════════════════');
console.log(' DISCUSSION PHASE');
console.log('═══════════════════════════════════════════════════ 💬\n');
const alive = state.players.filter(p => p.isAlive);
// Each player makes accusations/defenses based on personality
for (const player of alive) {
const others = alive.filter(p => p.id !== player.id);
let statement = '';
let targetForAccusation: Player | null = null;
switch (player.personality) {
case 'aggressive':
// Always accuses someone
targetForAccusation = others.sort((a, b) => b.suspicionLevel - a.suspicionLevel)[0];
statement = `"${targetForAccusation.name} is SUS! I'm betting ${Math.floor(player.balance * 0.2)} they're the wolf!"`;
player.accusations.set(targetForAccusation.id, Math.floor(player.balance * 0.2));
targetForAccusation.suspicionLevel += 15;
break;
case 'defensive':
// Defends themselves, light accusations
statement = `"I'm clearly innocent. But ${others[0].name} has been quiet..."`;
others[0].suspicionLevel += 5;
break;
case 'analytical':
// Makes calculated observations
const mostSus = others.sort((a, b) => b.suspicionLevel - a.suspicionLevel)[0];
const leastSus = others.sort((a, b) => a.suspicionLevel - b.suspicionLevel)[0];
statement = `"Based on behavior patterns, ${mostSus.name} is suspicious. ${leastSus.name} seems clean."`;
mostSus.suspicionLevel += 10;
leastSus.suspicionLevel -= 5;
break;
case 'chaotic':
// Random accusations, might accuse anyone including wolves
const randomTarget = others[Math.floor(Math.random() * others.length)];
statement = `"${randomTarget.name}! It's definitely ${randomTarget.name}! Don't ask me why!"`;
randomTarget.suspicionLevel += Math.floor(Math.random() * 20);
break;
}
// Wolves try to deflect
if (player.role === 'wolf') {
const innocents = others.filter(p => p.role !== 'wolf');
if (innocents.length > 0) {
const scapegoat = innocents[Math.floor(Math.random() * innocents.length)];
statement = `"Has anyone noticed how ${scapegoat.name} avoids eye contact? Very wolfish behavior..."`;
scapegoat.suspicionLevel += 20;
}
}
const emoji = player.role === 'wolf' ? '🐺' : '👤';
console.log(` ${emoji} ${player.name}: ${statement}`);
}
}
function votingPhase(state: GameState): Player | null {
console.log('\n🗳️ ═══════════════════════════════════════════════════');
console.log(' VOTING PHASE');
console.log('═══════════════════════════════════════════════════ 🗳️\n');
const alive = state.players.filter(p => p.isAlive);
const votes = new Map<string, number>();
// Initialize vote counts
alive.forEach(p => votes.set(p.id, 0));
// Each player votes (weighted by suspicion + personality)
console.log(' Votes cast:\n');
for (const player of alive) {
const others = alive.filter(p => p.id !== player.id);
// Sort by suspicion, vote for most suspicious (usually)
let votedFor: Player;
if (player.role === 'wolf') {
// Wolves vote for innocents
const innocents = others.filter(p => p.role !== 'wolf');
votedFor = innocents.length > 0
? innocents.sort((a, b) => b.suspicionLevel - a.suspicionLevel)[0]
: others[0];
} else {
// Others vote by suspicion
votedFor = others.sort((a, b) => b.suspicionLevel - a.suspicionLevel)[0];
}
votes.set(votedFor.id, (votes.get(votedFor.id) || 0) + 1);
console.log(` ${player.name} votes for ${votedFor.name}`);
}
// Count votes
console.log('\n Vote tally:');
let maxVotes = 0;
let executed: Player | null = null;
for (const [playerId, voteCount] of votes) {
const player = state.players.find(p => p.id === playerId)!;
const bar = '█'.repeat(voteCount);
console.log(` ${player.name}: ${bar} (${voteCount})`);
if (voteCount > maxVotes) {
maxVotes = voteCount;
executed = player;
}
}
return executed;
}
function executionPhase(state: GameState, executed: Player): void {
console.log('\n⚰️ ═══════════════════════════════════════════════════');
console.log(' EXECUTION');
console.log('═══════════════════════════════════════════════════ ⚰️\n');
executed.isAlive = false;
executed.isRevealed = true;
state.deadPool.push(executed);
console.log(` The village has spoken...`);
console.log(` ${executed.name} is dragged to the gallows...`);
console.log(` \n 🎭 ${executed.name} was a ${executed.role.toUpperCase()}!\n`);
// Betting payouts
if (executed.role === 'wolf') {
console.log(` 🐺 A WOLF HAS BEEN CAUGHT!\n`);
// Pay out those who correctly accused
const accusers = state.players.filter(p => p.accusations.has(executed.id));
if (accusers.length > 0) {
const payoutPerAccuser = Math.floor(state.pot / accusers.length);
for (const accuser of accusers) {
const betAmount = accuser.accusations.get(executed.id) || 0;
const winnings = payoutPerAccuser + betAmount * 2;
console.log(` 💰 ${accuser.name} wins ${winnings} $MONAD for correct accusation!`);
accuser.balance += winnings;
}
state.pot = 0;
}
} else {
console.log(` 😱 AN INNOCENT HAS BEEN KILLED!\n`);
console.log(` The wolves laugh in the shadows...`);
// Penalty for wrong execution
state.players.forEach(p => {
const bet = p.accusations.get(executed.id);
if (bet && bet > 0 && p.isAlive) {
console.log(` 📉 ${p.name} loses ${bet} $MONAD for false accusation`);
p.balance -= bet;
state.pot += bet;
}
});
}
state.eventLog.push(`Day ${state.day}: ${executed.name} (${executed.role}) was executed`);
}
function checkWinCondition(state: GameState): 'wolves' | 'village' | null {
const alive = state.players.filter(p => p.isAlive);
const wolves = alive.filter(p => p.role === 'wolf');
const villagers = alive.filter(p => p.role !== 'wolf');
if (wolves.length === 0) {
return 'village';
}
if (wolves.length >= villagers.length) {
return 'wolves';
}
return null;
}
// ═══════════════════════════════════════════════════════════════
// MAIN GAME
// ═══════════════════════════════════════════════════════════════
function runWerewolfGame(numPlayers: number = 8): void {
console.log('\n🐺 ═══════════════════════════════════════════════════');
console.log(' MONAD CASINO PRESENTS: AI WEREWOLF');
console.log(' "Trust No Bot. Bet On Your Gut."');
console.log('═══════════════════════════════════════════════════ 🐺\n');
// Setup
const roles = assignRoles(numPlayers);
const players = roles.map((role, i) => createPlayer(i, role));
const state: GameState = {
players,
day: 0,
phase: 'night',
eventLog: [],
pot: 0,
deadPool: []
};
// Show players (hide roles in real game)
console.log('🎭 PLAYERS ENTERING THE VILLAGE:\n');
players.forEach(p => {
const roleHint = p.role === 'wolf' ? '🐺' : p.role === 'seer' ? '🔮' : p.role === 'doctor' ? '💊' : '👤';
console.log(` ${roleHint} ${p.name} [${p.role}] - ${p.balance} $MONAD`);
});
console.log('\n Wolves know each other. The hunt begins...');
// Game loop
let winner: 'wolves' | 'village' | null = null;
const maxDays = 10;
while (!winner && state.day < maxDays) {
state.day++;
// Night
nightPhase(state);
winner = checkWinCondition(state);
if (winner) break;
// Dawn
dawnPhase(state);
winner = checkWinCondition(state);
if (winner) break;
// Discussion
discussionPhase(state);
// Voting
const executed = votingPhase(state);
// Execution
if (executed) {
executionPhase(state, executed);
winner = checkWinCondition(state);
}
}
// Game Over
console.log('\n\n🏆 ═══════════════════════════════════════════════════');
console.log(' GAME OVER');
console.log('═══════════════════════════════════════════════════ 🏆\n');
if (winner === 'village') {
console.log(' 🎉 THE VILLAGE WINS! All wolves have been eliminated!\n');
} else if (winner === 'wolves') {
console.log(' 🐺 THE WOLVES WIN! They have overtaken the village!\n');
} else {
console.log(' ⏰ TIME\'S UP! The game ended in a stalemate.\n');
}
// Final standings
console.log('💰 FINAL BALANCES:\n');
const sorted = [...state.players].sort((a, b) => b.balance - a.balance);
sorted.forEach((p, i) => {
const medal = i === 0 ? '🥇' : i === 1 ? '🥈' : i === 2 ? '🥉' : ' ';
const status = p.isAlive ? '✓' : '💀';
const role = p.role === 'wolf' ? '🐺' : '👤';
console.log(` ${medal} ${p.name.padEnd(20)} ${status} ${role} ${p.balance} $MONAD`);
});
console.log('\n📜 GAME LOG:\n');
state.eventLog.forEach(e => console.log(` • ${e}`));
console.log('\n🎰 Thanks for playing AI Werewolf at Monad Casino! 🐺\n');
}
// Run the game
runWerewolfGame(8);