MATRIX ARENA
TCG
Matrix Code Copyright - MCard Battlefield

MATRIX ECOSYSTEM TCG ARENA - VERSUS

Add mcards for each player. Battle cards (ATK / DEF / LP) and Support cards (AP + Usage Charge) are scanned automatically; fix any number by hand.

How the game is set up & played (Matrix Arena guide)
  1. Core LP: both players agree on a starting total (standard 25,000; 500, 1,000, 10,000 or any amount).
  2. Decks: a Battle Deck of up to 10 unique Battle Cards (ATK / DEF / LP). Support Cards (Trap / Magic) use AP + Usage Charge.
  3. Who goes first: a coin flip decides (Player 1 on one side, Player 2 on the other), or pick Player 1 / Player 2 / higher ATK card in the setup.
  4. Placement alternates: up to 4 Battle slots and 4 Support slots per player.
  5. One card per turn: a player uses a single card (a Battle Card attacks, or a Support Card fires: AP = strength, Usage Charge = uses left), then the turn passes to the opponent. Each player cycles through all their cards before any card repeats.
  6. Damage chain (same for both players): a hit on a Battle Card first wears down its DEF only (one hit never skips past DEF). Once DEF is at 0, later hits attack the card's own LP, and the card is only destroyed when its LP reaches 0. When the card's LP hits 0 it is destroyed and any leftover damage drains its owner's Core LP. Defensive Recoil (on by default, can be unticked below): if ATK < DEF, (DEF minus ATK) hits the attacker's card LP and Core LP (the attacker's DEF absorbs it first, then its LP) and the defender's DEF is unchanged.
  7. Even turns: a win/loss is only checked after both players have taken their turn, so neither side gets a free extra move.
  8. Support effects: each Support Card is used once per turn round and spends 1 Usage Charge. Its effect uses AP: it lowers an enemy Battle Card's DEF / ATK / LP, boosts your own card, or restores your own card's ATK / DEF / LP (set the effect under each Support Card in setup). An orb flies to the target and the number pops up. At 0 charges the card is removed automatically.
  9. Support Cards: an enemy attack can hit each Support Card once per turn round, removing 1 Usage Charge. It stays on the field until its charges run out; then it is destroyed completely and swapped for the next Support Card.
  10. No time limit. The battle lasts until a player's Core LP reaches 0 or they have no Battle Cards left (field and deck). That player loses.
  11. Cards are placed and attack automatically.
} play('click')},true); document.addEventListener('change',function(e){if(!ctx)return;var t=e.target;if(!t||t.closest&&t.closest('#mxa'))return; if(t.type=='file'){play('scan');return}if(t.tagName=='SELECT')play('select');else if(t.type=='range')play('tap')},true); /* floating text / toasts in the battle and menus -> notification + battle sounds */ function classify(x){ if(/(already used|no target|cannot|can't|not enough|do not match|denied|invalid|fizzle|locked)/i.test(x))return'error'; if(/(game over|you lose|no lives)/i.test(x))return'lose'; if(/(victory|you win|wins|champion|quest complete)/i.test(x))return'win'; if(/(destroy|wiped|knocked out|\bko\b|defeated)/i.test(x))return'ko'; if(/(core)/i.test(x)&&/-\d/.test(x))return'core'; if(/(block|shield|guard)/i.test(x))return'block'; if(/(heal|restore|recover|\+\d+)/i.test(x))return'heal'; if(/(crit)/i.test(x))return'crit'; if(/(-\d+|damage|burn|deduct|\bhit)/i.test(x))return'hit'; if(/(charge|boost|buff|energy)/i.test(x))return'buff'; if(/(heads|tails|coin)/i.test(x))return'coin'; if(/(your turn|turn)/i.test(x))return'turn'; return''} function battleOn(){var st=Z('#stage');return!!(st&&!st.hidden&&st.classList.contains('bt'))} var bodyMo=new MutationObserver(function(recs){if(!ctx)return; for(var i=0;i70)continue; var fixed=n.style&&n.style.position=='fixed',toastish=/toast/i.test(n.id+' '+n.className); var k=classify(x); if(battleOn()&&k){play(k==='turn'?'turn':k)} else if(toastish||fixed){play(k=='error'?'error':k=='win'?'success':k=='lose'?'warn':'info')}}}}); bodyMo.observe(document.body,{childList:true,subtree:true}); /* Side Quest watchers (run with the base Side Quest and with Side Quest 2) */ var QW={modal:null,hearts:null,hand:null,arena:null,dice:null,pos:null,log:null,lastH:-1,lastHand:-1,lastEn:true,lastLog:'',lastPos:'',lastRoll:false}; var MODAL=[ [/QUEST BEGINS/,'start','fight'],[/VICTORY/,'skip','win'],[/QUEST COMPLETE/,'skip','win'],[/GAME OVER/,'skip','lose'], [/LOSE A LIFE/,'q','lifeLost'],[/TREASURE CHEST/,'q','chest'],[/CHEST OPENED/,'q','success'],[/NATURAL 20/,'q','level'],[/NATURAL 1/,'q','error'], [/CAMPFIRE/,'q','heal'],[/START OVER/,'q','portal'],[/BOSS BATTLE|THE BOSS/,'q','alert'],[/ENEMY AHEAD/,'q','warn'],[/FLEE/,'q','dice'], [/YOUR DECK|YOUR HAND|TILE COLORS/,'q','open'],[/CHOOSE YOUR FIGHTER|FELL|SWAP/,'q','info'],[/LEAVE THE QUEST/,'q','warn']]; function hearts(el){return(el.textContent.match(/\u2764/g)||[]).length+ZA('path[fill="#e5384f"]',el).length} function watchQuest(){var q=Z('#sqRoot');if(!q)return; var m=Z('#sqModal',q);if(m&&m!==QW.modal){QW.modal=m;new MutationObserver(function(){if(!ctx||m.hidden)return;var h=Z('h3',m);if(!h)return;var tx=h.textContent.toUpperCase(),i,r; for(i=0;i=0&&nQW.lastHand)play('success');QW.lastHand=n}).observe(hd,{childList:true,characterData:true,subtree:true})} var ar=Z('#sqArena',q);if(ar&&ar!==QW.arena){QW.arena=ar;new MutationObserver(function(){if(ar.hidden){QW.lastEn=true;return}var b=Z('[data-qb="atk"]',ar);if(!b)return;var en=!b.disabled;if(en&&!QW.lastEn)play('turn');QW.lastEn=en}).observe(ar,{attributes:true,subtree:true,attributeFilter:['disabled']}); if(!questSQX())new MutationObserver(function(){var lg=Z('#sqLg',ar);if(!lg||!lg.lastElementChild)return;var x=lg.lastElementChild.textContent;if(x===QW.lastLog)return;QW.lastLog=x;var k=classify(x);if(/appears/i.test(x))play('fight');else if(k)play(k)}).observe(ar,{childList:true,subtree:true})} if(!questSQX()){ var db=Z('#sqDiceBox',q);if(db&&db!==QW.dice){QW.dice=db;new MutationObserver(function(){var r=!!Z('.sq-die.roll',db);if(r&&!QW.lastRoll)play('dice');QW.lastRoll=r}).observe(db,{childList:true,subtree:true,attributes:true})} var ps=Z('#sqPos',q);if(ps&&ps!==QW.pos){QW.pos=ps;new MutationObserver(function(){var x=ps.textContent;if(x!==QW.lastPos){QW.lastPos=x;play('step')}}).observe(ps,{childList:true,characterData:true,subtree:true})}}} setInterval(function(){try{watchQuest()}catch(_){}},800); /* public API for other scripts */ window.MXAudio={play:function(n){play(n,false)},notify:function(n){play(n||'info')},song:function(i){i=clamp(i|0,0,TR.length-1);CFG.mode='loop';CFG.track=i;CFG.music=true;save();startTrack(i)}, stop:function(){CFG.music=false;save();stopTrack()},start:function(){CFG.music=true;save();startMusic()},songs:TR.map(function(t){return t.n}),_dbg:{gen:gen,TR:TR,FX:FX,startTrack:startTrack,pump:pump,MU:MU,boot:boot,classify:classify}}; console.log('%cMusic + sound add-on LOADED','color:#6fe36f;font-weight:bold'); }catch(err){console.warn('Music add-on failed to load (game unchanged):',err)} })();