BATTLEBOX: Robot Combat Arena
README.md
bots.botcore
The body of a corner robot, for any design built from parts. Every number comes from Rules.stats(slot), and the look is built by bots.assembler.
- Drive: tank drive from the parts' derived speed, acceleration and turn. A side that lost wheels drives weaker and makes the bot pull. Lost batteries cut the power, and with none left nothing drives or spins.
- Contact: arena walls and bot-on-bot shoving use each bot's oriented footprint (its parts' bounds), not a circle.
- Weapons: every weapon part works on its own.
- Spinners spin up and down from where they are mounted. Vertical discs and drums bite with the front arc; horizontal spinners hit all round within their sweep at hub height.
bot:fire()fires every charged cycle weapon at once (flipper, lifter, hammer, crusher). Hammers and crushers come down from above onto the top part under their tip.- Spikes hit for
ramDamage× closing speed × mass / 100 kg.
- Hits: each hit lands on the first surviving victim part the weapon meets, so armour in front of internals takes it. Damage is the weapon's damage × that part's
armorScale, ×1.6 on batteries and receivers. It comes off the bot's health and the part's own hp (armour and structure parts absorb 30% into their hp). - Events:
"hit"carriespart,partTypeandweaponId."partDamaged"and"partLost"fire on part damage and loss. A lost receiver destroys the bot, and lost batteries lead to an immobile KO. A lost wheel weakens its side, a lost weapon stops, and a lost self-righter can't right the bot any more."reset"restores every part. - Rules record: writes
rpm(the primary weapon),weaponFraction,weapons[id] = { rpm, charge, lost },partHp,immobileSecondsandflippedtoRules.bot(slot)every frame. - Sim bodies:
Core.newSimmakes a headless body that never touches the live match, used bybots.fightsim.
Used by bots.HavocBot, bots.RiptideBot and bots.fightsim. Core.get(slot) returns the live bot.