Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print("\nTest Starting")
- --Created by Vaeb
- --Purpose: Viewing which armor/sword combinations are more likely to win in a battle
- --Important: Only change lines with a comment saying [CHANGE] following them
- local HealthNum = 350 --[CHANGE] Your estimated character health (Level 30 is around 350)
- local AttackTime = 1.2
- local RegenTime = 9
- local WaitSpeed = 0.5
- local DivideNum = 1/WaitSpeed
- local RegensToAttack = RegenTime/AttackTime
- local BaseRegen = math.ceil(HealthNum/6)
- --Get armor stats from:
- --http://saob.wikia.com/wiki/Armor
- --http://saob.wikia.com/wiki/Armor_Extension
- --Get sword stats from:
- --http://saob.wikia.com/wiki/Weapons
- --http://saob.wikia.com/wiki/Weapons_V0.4.1
- local Armors = {
- [1] = { --Player 1
- ["Name"] = "Rapier"; --[CHANGE] Choose a name
- ["Damage"] = (29+29); --[CHANGE] Total damage in swords
- ["Health"] = HealthNum + (70+0+0); --[CHANGE] Total health in character, armor and swords
- ["Regen"] = BaseRegen + (25+0+0); --[CHANGE] Total health regen in character, armor and swords
- ["Died"] = false;
- };
- [2] = { --Player 2
- ["Name"] = "LastWish"; --[CHANGE] Choose a name
- ["Damage"] = (28+28); --[CHANGE] Total damage in swords
- ["Health"] = HealthNum + (70+0+0); --[CHANGE] Total health in character, armor and swords
- ["Regen"] = BaseRegen + (25+45+45); --[CHANGE] Total health regen in character, armor and swords
- ["Died"] = false;
- };
- }
- for i,v in pairs(Armors) do
- Armors[i]["OrigHealth"] = Armors[i]["Health"]
- end
- local StartTime = tick()
- local RegenNum = 0
- local TestDone = #Armors
- coroutine.resume(coroutine.create(function()
- while true do
- wait(WaitSpeed*RegensToAttack)
- if TestDone <= 1 then
- break
- end
- for i,v in pairs(Armors) do
- Armors[i]["Health"] = Armors[i]["Health"] + (Armors[i]["Regen"])
- print("Regened " .. Armors[i]["Name"] .. " +" .. tostring(Armors[i]["Regen"]) .. " : Health: " .. tostring(Armors[i]["Health"]))
- end
- print("")
- end
- end))
- while true do
- for i,v in pairs(Armors) do
- local OtherNum = (((i == 1) and 2) or 1)
- Armors[i]["Health"] = math.max(Armors[i]["Health"] - Armors[OtherNum]["Damage"], 0)
- print(Armors[i]["Name"] .. " Was Damaged : Health: " .. tostring(Armors[i]["Health"]))
- if Armors[i]["Health"] <= 0 then
- print("/// [" .. tostring(math.floor((tick()-StartTime)*DivideNum)) .. "s] " .. Armors[i]["Name"] .. " Died \\\\\\")
- TestDone = TestDone - 1
- Armors[i]["Died"] = true
- end
- print("")
- end
- print("-----------------------------\n")
- if TestDone == 1 then
- for i,v in pairs(Armors) do
- if Armors[i]["Died"] == false then
- print("Test Complete : Winner: " .. Armors[i]["Name"])
- end
- end
- break
- elseif TestDone == 0 then
- print("Test Complete : Tie")
- break
- end
- wait(WaitSpeed)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement