783 healHp = 5 * factor |
783 healHp = 5 * factor |
784 |
784 |
785 -- Add extra 10% of hogs base hp to heal |
785 -- Add extra 10% of hogs base hp to heal |
786 healHp = healHp + div(getHogInfo(CurHog, 'maxHp'), 10) |
786 healHp = healHp + div(getHogInfo(CurHog, 'maxHp'), 10) |
787 |
787 |
788 AddCaption(loc("+ ") .. healHp .. loc(" hp"), msgColor, capgrpMessage) |
788 AddCaption(string.format(loc("+%d"), healHp), msgColor, capgrpMessage) |
789 |
789 |
790 SetEffect(CurHog, hePoisoned, 0) |
790 SetEffect(CurHog, hePoisoned, 0) |
791 SetHealth(CurHog, hogHealth + healHp) |
791 SetHealth(CurHog, hogHealth + healHp) |
792 local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtHealthTag, healHp, false) |
792 local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtHealthTag, healHp, false) |
793 -- (vgUid, X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint) |
793 -- (vgUid, X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint) |
829 |
829 |
830 randIndex = GetRandom(table.getn(possibleWeapons)) +1 |
830 randIndex = GetRandom(table.getn(possibleWeapons)) +1 |
831 randAmmo = possibleWeapons[randIndex] |
831 randAmmo = possibleWeapons[randIndex] |
832 end |
832 end |
833 |
833 |
834 AddCaption(loc("+ ") .. factor .. loc(" ammo"), msgColor, capgrpMessage) |
834 AddCaption(string.format(loc("+%d ammo"), factor), msgColor, capgrpMessage) |
835 |
835 |
836 AddAmmo(CurHog, randAmmo, GetAmmoCount(CurHog, randAmmo) +factor) |
836 AddAmmo(CurHog, randAmmo, GetAmmoCount(CurHog, randAmmo) +factor) |
837 local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtAmmo, 0, true) |
837 local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtAmmo, 0, true) |
838 -- (vgUid, X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint) |
838 -- (vgUid, X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint) |
839 SetVisualGearValues(effect, nil, nil, nil, nil, nil, randAmmo, nil, nil, nil, msgColor) |
839 SetVisualGearValues(effect, nil, nil, nil, nil, nil, randAmmo, nil, nil, nil, msgColor) |
870 |
870 |
871 randIndex = GetRandom(table.getn(possibleHelpers)) +1 |
871 randIndex = GetRandom(table.getn(possibleHelpers)) +1 |
872 randUtility = possibleHelpers[randIndex] |
872 randUtility = possibleHelpers[randIndex] |
873 end |
873 end |
874 |
874 |
875 AddCaption(loc("+ ") .. factor .. loc(" ammo"), msgColor, capgrpMessage) |
875 AddCaption(string.format(loc("+%d ammo"), factor), msgColor, capgrpMessage) |
876 |
876 |
877 AddAmmo(CurHog, randUtility, GetAmmoCount(CurHog, randUtility) +factor) |
877 AddAmmo(CurHog, randUtility, GetAmmoCount(CurHog, randUtility) +factor) |
878 local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtAmmo, 0, true) |
878 local effect = AddVisualGear(GetX(CurHog), GetY(CurHog) +cratePickupGap, vgtAmmo, 0, true) |
879 -- (vgUid, X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint) |
879 -- (vgUid, X, Y, dX, dY, Angle, Frame, FrameTicks, State, Timer, Tint) |
880 SetVisualGearValues(effect, nil, nil, nil, nil, nil, randUtility, nil, nil, nil, msgColor) |
880 SetVisualGearValues(effect, nil, nil, nil, nil, nil, randUtility, nil, nil, nil, msgColor) |
1610 |
1610 |
1611 local txt = '' |
1611 local txt = '' |
1612 local icon = 0 |
1612 local icon = 0 |
1613 |
1613 |
1614 if mode ~= 'points' then |
1614 if mode ~= 'points' then |
1615 txt = txt .. loc("Variants: Hogs will be randomized from 12 different variants|") |
1615 txt = txt .. loc("Variants: Hogs will be randomized from 12 different variants") .. "|" |
1616 txt = txt .. loc("Weapon: Hogs will get 1 out of 3 weapons randomly each turn|") |
1616 txt = txt .. loc("Weapons: Hogs will get 1 out of 3 weapons randomly each turn") .. "|" |
1617 txt = txt .. loc("Helper: Hogs will get 1 out of 2 helpers randomly each turn|") |
1617 txt = txt .. loc("Helpers: Hogs will get 1 out of 2 helpers randomly each turn") .. "|" |
1618 txt = txt .. loc("Crates: Crates spawn randomly with chance of being empty|") |
1618 txt = txt .. loc("Crates: Crates drop randomly with chance of being empty") .. "|" |
1619 txt = txt .. loc("Hogs: Less than 25% base hp gives +Kamikaze|") |
1619 txt = txt .. loc("Last Resort: Having less than 25% base health gives kamikaze") .. "|" |
1620 txt = txt .. loc("Flags: Unlimited Ammo, Per Hog Ammo|") |
1620 txt = txt .. loc("Modifiers: Unlimited ammo, per-hog ammo") .. "|" |
1621 else |
1621 else |
1622 txt = txt .. loc("Crates: Crates spawn randomly with chance of being empty|") |
1622 txt = txt .. loc("Crates: Crates drop randomly and may be empty") .. "|" |
1623 txt = txt .. loc("Flags: Unlimited Ammo, Shared Team Ammo|") |
1623 txt = txt .. loc("Modifiers: Unlimited ammo, shared clan ammo") .. "|" |
1624 end |
1624 end |
1625 |
1625 |
1626 if luck ~= 100 then |
1626 if luck ~= 100 then |
1627 txt = txt .. loc("Luck: ") .. luck .. loc("% (modifier for crates)|") |
1627 txt = txt .. string.format(loc("Luck: %d%% (modifier for crates)"), luck) .. "|" |
1628 end |
1628 end |
1629 |
1629 |
1630 if strength > 1 then |
1630 if strength > 1 then |
1631 txt = txt .. loc("Strength: ") .. strength .. loc(" (multiplier for ammo)|") |
1631 txt = txt .. string.format(loc("Strength: %d (multiplier for ammo)"), strength) .. "|" |
1632 end |
1632 end |
1633 |
1633 |
1634 if mode == 'highland' then |
1634 if mode == 'highland' then |
1635 txt = txt .. loc(" |") |
1635 txt = txt .. " |" |
1636 txt = txt .. loc("--- Highland --- |") |
1636 txt = txt .. loc("--- Highland ---").."|" |
1637 txt = txt .. loc("Enemy kills: Collect victims weapons and + ") .. highEnemyKillHPBonus .. loc(" % of its base health|") |
1637 txt = txt .. string.format(loc("Enemy kills: Collect victim's weapons and +%d%% of its base health"), highEnemyKillHPBonus).."|" |
1638 txt = txt .. loc("Friendly kills: Clears killers pool and - ") .. highFriendlyKillHPBonus .. loc(" % of its base health|") |
1638 txt = txt .. string.format(loc("Friendly kills: Clear killer's pool and -%d%% of its base health"), highFriendlyKillHPBonus).."|" |
1639 txt = txt .. loc("Turns: Hogs get ") .. highPickupCount .. loc(" random weapon(s) from their pool|") |
1639 txt = txt .. string.format(loc("Turns: Hogs get %d random weapon(s) from their pool"), highPickupCount).."|" |
1640 txt = txt .. loc("Hint: Kills wont transfer a hogs pool to the killers pool|") |
1640 txt = txt .. loc("Hint: Kills won't transfer a hog's pool to the killer's pool").."|" |
1641 txt = txt .. loc("Specials: Kings and Air-General drop helpers, not weapons|") |
1641 txt = txt .. loc("Specials: Kings and air generals drop helpers, not weapons").."|" |
1642 icon = 1 -- Target |
1642 icon = 1 -- Target |
1643 elseif mode == 'king' then |
1643 elseif mode == 'king' then |
1644 txt = txt .. loc(" |") |
1644 txt = txt .. " |" |
1645 txt = txt .. loc("--- King --- |") |
1645 txt = txt .. loc("--- King ---").."|" |
1646 txt = txt .. loc("Variants: The last hog of each team will be a king|") |
1646 txt = txt .. loc("Variants: The last hog of each team will be a king").."|" |
1647 txt = txt .. loc("Turns: Kings health are set to ") .. kingLinkPerc .. loc("% of the team health|") |
1647 txt = txt .. string.format(loc("Turns: King's health is set to %d%% of the team health"), kingLinkPerc).."|" |
1648 icon = 0 -- Golen Crown |
1648 icon = 0 -- Golen Crown |
1649 elseif mode == 'points' then |
1649 elseif mode == 'points' then |
1650 txt = txt .. loc(" |") |
1650 txt = txt .. " |" |
1651 txt = txt .. loc("--- Points --- |") |
1651 txt = txt .. loc("--- Points ---").."|" |
1652 txt = txt .. loc("Variants: Disables King and Air-General|") |
1652 txt = txt .. loc("Variants: King and air general are disabled").."|" |
1653 txt = txt .. loc("Weapons: Every team starts with ") .. pointsWepBase .. loc(" weapon points|") |
1653 txt = txt .. string.format(loc("Weapons: Each team starts with %d weapon points"), pointsWepBase).."|" |
1654 txt = txt .. loc("Helpers: Every team starts with ") .. pointsHlpBase .. loc(" helper points|") |
1654 txt = txt .. string.format(loc("Helpers: Each team starts with %d helper points"), pointsHlpBase).."|" |
1655 txt = txt .. loc("Turns: Refills ") .. pointsWepTurn .. loc(" weapon and ") .. pointsHlpTurn .. loc(" helper points|") |
1655 txt = txt .. string.format(loc("Turns: Refill %d weapon and %d helper points|and randomize weapons and helpers based on team points"), pointsWepTurn, pointsHlpTurn).."|" |
1656 txt = txt .. loc(" and randomizes weapons and helpers based on team points|") |
|
1657 icon = 4 -- Golden Star |
1656 icon = 4 -- Golden Star |
1658 else |
1657 else |
1659 icon = -amGrenade -- Grenade |
1658 icon = -amGrenade -- Grenade |
1660 end |
1659 end |
1661 |
1660 |
1662 --txt = txt .. "Switch: Max. 3 times a game per team, cooldown of 5 turns|" |
1661 --txt = txt .. "Switch: Max. 3 times a game per team, cooldown of 5 turns|" |
1663 txt = txt .. loc(" |") |
1662 txt = txt .. " |" |
1664 txt = txt .. loc("--- Sudden Death --- |") |
1663 txt = txt .. loc("--- Sudden Death ---").."|" |
1665 txt = txt .. loc("Weapons: +Kamikaze, +1 for nearly every hog variant|") |
1664 txt = txt .. loc("Weapons: Nearly every hog variant gets 1 kamikaze").."|" |
1666 txt = txt .. loc("Crates: Crates spawn more frequently with higher chance of bonus|") |
1665 txt = txt .. loc("Crates: Crates drop more often with a higher chance of bonus ammo").."|" |
1667 txt = txt .. loc("Water: Rises by 37 per Round|") |
1666 txt = txt .. loc("Water: Rises by 37 per turn").."|" |
1668 txt = txt .. loc("Hogs: Loose up to 7% base hp per turn|") |
1667 txt = txt .. loc("Health: Hogs lose up to 7% base health per turn").."|" |
1669 |
1668 |
1670 if mode == 'default' then |
1669 if mode == 'default' then |
1671 txt = txt .. loc(' |') |
1670 txt = txt .. " |" |
1672 txt = txt .. loc('--- Hint ---|') |
1671 txt = txt .. loc("--- Hint ---").."|" |
1673 txt = txt .. loc('Modes: Activate highland, king or points mode by putting mode=<name>|') |
1672 txt = txt .. loc("Modes: Activate “highland”, “king” or “points” mode by putting mode=<name>|into the script parameter").."|" |
1674 txt = txt .. loc(' into the script params|') |
|
1675 end |
1673 end |
1676 |
1674 |
1677 if mode == 'highland' then |
1675 if mode == 'highland' then |
1678 txt = txt .. loc("Highland: Hogs get ") .. highPickupSDCount .. loc(" random weapons from their pool|") |
1676 txt = txt .. string.format(loc("Highland: Hogs get %d random weapons from their pool"), highPickupSDCount) .. "|" |
1679 end |
1677 end |
1680 |
1678 |
1681 ShowMission(loc("Battalion v") .. version, loc("Less tools, more fun.") .. " (by Anachron)", txt, icon, 1000) |
1679 ShowMission(loc("Battalion"), loc("Less tools, more fun"), txt, icon, 1000) |
1682 |
1680 |
1683 -- Tell the user about the amount of rounds until sudden death |
1681 -- Tell the user about the amount of rounds until sudden death |
1684 AddCaption(loc("SuddenDeathTurns set to ") .. (SuddenDeathTurns +2), 0x808080, capgrpGameState) |
1682 AddCaption(string.format(loc("Rounds until Sudden Death: %d"), SuddenDeathTurns +2), 0xFFFFFFFF, capgrpGameState) |
1685 end |
1683 end |
1686 |
1684 |
1687 function onGameInit() |
1685 function onGameInit() |
1688 --[[ CONFIGURATEABLE FOR PLAYERS ]]-- |
1686 --[[ CONFIGURATEABLE FOR PLAYERS ]]-- |
1689 --[[ ONCE IT HAS BEEN ADDED TO HW ]]-- |
1687 --[[ ONCE IT HAS BEEN ADDED TO HW ]]-- |