Tactical Combat Decision Maker
Apr 3, 2025
v.0
A fun and interactive web app that helps you simulate combat decisions based on enemy proximity and engagement rules. Game Interactive HTML5 Simulation Strategy Combat Tactics Close combat

Versions  

Bugs  
None!

Get This App On Your Website

1. Copy the code above with the iframe and link.
2. Paste the code into your website.
3. Resize the iframe to fit your website.

Javascript, HTML, CSS Code

                
<html>
<head>
<script type="text/javascript"> window.addEventListener('error', function(event) { var message = JSON.parse(JSON.stringify(event.message)); var source = event.filename; var lineno = event.lineno; var colno = event.colno; var error = event.error; window.parent.postMessage({ type: 'iframeError', details: { message: message, source: source, lineno: lineno, colno: colno, error: error ? error.stack : '' } }, '*'); }); window.addEventListener('unhandledrejection', function(event) { window.parent.postMessage({ type: 'iframePromiseRejection', details: { reason: event.reason } }, '*'); }); </script>

<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1">

<title>Adeptus Titanicus Solo AI</title>
<meta name="description" content="An interactive web application for managing Titans in Adeptus Titanicus, allowing users to simulate orders and combat decisions.">
<meta name="keywords" content="Titan, Adeptus Titanicus, combat, simulation, strategy, orders, game, AI, HTML5, interactive">

<style>
body {
font-family: 'Roboto', sans-serif;
background: linear-gradient(to right, #4facfe 0%, #00f2fe 100%);
margin: 0;
color: #333;
}
.container {
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
background-color: rgba(255, 255, 255, 0.9);
max-width: 800px;
margin: auto;
margin-top: 50px;
}
h1, h2 {
text-align: center;
color: #ff6f61;
}
.titan-card {
border: 1px solid #555;
border-radius: 10px;
padding: 10px;
margin-bottom: 15px;
background-color: #f9f9f9;
}
.btn {
background-color: #ff6f61;
color: #fff;
border: none;
padding: 10px 20px;
border-radius: 5px;
cursor: pointer;
font-size: 1em;
text-transform: uppercase;
}
.log {
background-color: #e0e0e0;
padding: 10px;
border-radius: 5px;
margin-top: 20px;
}
</style>

<link rel="canonical" href="https://calculator.tools/app/tactical-combat-decision-maker-1484/">
<meta charset="utf-8">

</head>
<body>
<div class="container">
<h1>Adeptus Titanicus Solo AI</h1>
<div id="titan-container"></div>
<button class="btn" id="next-phase-button">Next Phase (ORDER)</button>
<div class="log" id="log-container"><h2>Log</h2></div>
</div>

<script>
const titans = [
{
id: 1,
name: "Reaver Titan",
variant: "Goth",
VSG: 5,
position: { x: 3, y: 2 },
weapons: [
{
name: "Las-cannon",
range: { short: 30, long: 60 },
crit: 4,
}
],
damage: {},
order: null
}
];

const getBestOrder = (titan, enemyDistance) => {
if (titan.damage.reactor) return "DAMAGE CONTROL";
if (enemyDistance < 12) return "CHARGE";
if (enemyDistance < 60) return "FIRST FIRE";
return "ADVANCE";
};

const applyDamage = (titan) => {
const damageRoll = Math.ceil(Math.random() * 6);
let location;
switch (damageRoll) {
case 1: location = "leftArm"; break;
case 2: location = "rightArm"; break;
case 3: location = "carapace"; break;
case 4: location = "legs"; break;
case 5: location = "MIUs"; break;
case 6: location = "reactor"; break;
default: location = "body";
}
const newDamage = { ...titan.damage, [location]: true };
return { ...titan, damage: newDamage };
};

let phase = "ORDER";
let log = [];
let state = titans;

const updateTitanCards = () => {
const titanContainer = document.getElementById('titan-container');
titanContainer.innerHTML = '';
state.forEach(titan => {
const card = document.createElement('div');
card.className = 'titan-card';
card.innerHTML = `
<p class="font-bold">${titan.name} (${titan.variant})</p>
<p>Order: ${titan.order || "None"}</p>
<p>VSG: ${titan.VSG}</p>
<p>Damage: ${Object.keys(titan.damage).length ? Object.keys(titan.damage).join(", ") : "None"}</p>
`;
titanContainer.appendChild(card);
});
};

document.getElementById('next-phase-button').onclick = () => {
if (phase === "ORDER") {
state = state.map(titan => {
const enemyDistance = 20;
const order = getBestOrder(titan, enemyDistance);
return { ...titan, order };
});
log.push("Orders assigned");
phase = "MOVEMENT";
} else if (phase === "MOVEMENT") {
log.push("Titans moved");
phase = "REPAIR";
} else if (phase === "REPAIR") {
state = state.map(titan => {
let newDamage = { ...titan.damage };
if (titan.order === "DAMAGE CONTROL") {
for (let system in newDamage) {
if (Math.ceil(Math.random() * 6) + 1 >= 5) {
delete newDamage[system];
}
}
}
return { ...titan, damage: newDamage };
});
log.push("Repairs resolved");
phase = "COMBAT";
} else if (phase === "COMBAT") {
state = state.map(applyDamage);
log.push("Combat executed, damage applied");
phase = "END";
} else {
log.push("New turn");
phase = "ORDER";
}
updateTitanCards();
document.getElementById('log-container').innerHTML = "<h2>Log</h2>" + log.map((entry, i) => `<p key=${i} class="text-sm">- ${entry}</p>`).join("");
};

updateTitanCards();
</script>
<script type="text/javascript"> var localStoragePrefix = "ct-1484"; var lastSave = 0; function saveLocal(data) { if (Date.now() - lastSave < 1000) { return; } let cookie = localStoragePrefix + "=" + JSON.stringify(data) + "; path=" + window.location.pathname + "'; SameSite=Strict"; cookie += "; expires=" + new Date(Date.now() + 1000 * 60 * 60 * 24 * 365 * 1000).toUTCString(); document.cookie = cookie; lastSave = Date.now(); } function loadLocal() { var cookiePrefix = localStoragePrefix + "="; var cookieStart = document.cookie.indexOf(cookiePrefix); if (cookieStart > -1) { let cookieEnd = document.cookie.indexOf(";", cookieStart); if (cookieEnd == -1) { cookieEnd = document.cookie.length; } var cookieData = document.cookie.substring(cookieStart + cookiePrefix.length, cookieEnd); return JSON.parse(cookieData); } } </script>
<script type="text/javascript"> window.addEventListener('load', function() { var observer = new MutationObserver(function() { window.parent.postMessage({height: document.documentElement.scrollHeight || document.body.scrollHeight},"*"); }); observer.observe(document.body, {attributes: true, childList: true, subtree: true}); window.parent.postMessage({height: document.documentElement.scrollHeight || document.body.scrollHeight},"*"); }); </script>
</body>
</html>

NEW APPS

These are apps made by the community!

FAQ

What is Calculator Tools?

Calculator Tools allows you to instantly create and generate any simple one page web app for free and immediately have it online to use and share. This means anything! Mini apps, calculators, trackers, tools, games, puzzles, screensavers... anything you can think of that the AI can handle.

The AI uses Javacript, HTML, and CSS programming to code your app up in moments. This currently uses GPT-4 the latest and most powerful version of the OpenAI GPT language model.

What Do You Mean Make An App?

Have you ever just wanted a simple app but didn't want to learn programming or pay someone to make it for you? Calculator Tools is the solution! Just type in your prompt and the AI will generate a simple app for you in seconds. You can then customize it to your liking and share it with your friends.

AI has become so powerful it is that simple these days.

Does This Use ChatGPT?

It uses GPT-4 which is the most powerful model for ChatGPT.

Calculator Tools does not remember things from prompt to prompt, each image is a unique image that does not reference any of the images or prompts previously supplied.