Module:Combat/Tests

local Ship = require("Module:Ship") local EnemyShip = require("Module:EnemyShip") local ShipCapabilities = require("Module:ShipCapabilities") local Combat = require("Module:Combat").Combat2

local Tests = {}

local nagato = ShipCapabilities{ ship = Ship("Nagato/Kai"){ _equipment = { { equipment = "41cm Twin Gun Mount" }, { equipment = "41cm Twin Gun Mount" }, { equipment = "Type 0 Observation Seaplane" }, { equipment = "Type 1 Armor Piercing Shell" }, }   },    _spotting = Combat.spotting.cut_in.main_main, _ap = Combat.ap.main_ap, }

local yamato = ShipCapabilities{ ship = Ship("Yamato/Kai"){ _equipment = { { equipment = "Prototype 51cm Twin Gun Mount" }, { equipment = "Prototype 51cm Twin Gun Mount" }, { equipment = "Type 0 Observation Seaplane" }, { equipment = "Type 1 Armor Piercing Shell" }, }   },    _spotting = Combat.spotting.cut_in.main_main, _ap = Combat.ap.main_ap, }

local wo = EnemyShip("Standard Carrier Wo-Class/Kai Flagship") local ad_hime = EnemyShip("Air Defense Princess/Strong") ad_hime._armor = 200

local c = Combat

Tests.test1 = c:damage(Combat.day_battle, nagato) Tests.test2 = c:damage(Combat.day_battle, nagato, wo)

nagato._ammo_bars = 4 yamato._ammo_bars = 4

c = Combat{ fleet = Combat.fleet.stf_main.line_ahead, engagement = Combat.engagement.red_t, }

Tests.test3 = c:damage(Combat.day_battle, nagato, ad_hime) Tests.test4 = c:damage(Combat.day_battle, yamato, ad_hime)

-- print(p.test1) print(p.test2.min, p.test2.max) print(p.test3.min, p.test3.max) print(p.test4.min, p.test4.max) --

return Tests