Skip to content

Commit

Permalink
Campaigns: Add 'Wings of Victory' (Drake Campaign)
Browse files Browse the repository at this point in the history
  • Loading branch information
sigurdfdragon committed May 1, 2019
1 parent 38dbf99 commit 1141a07
Show file tree
Hide file tree
Showing 92 changed files with 5,260 additions and 0 deletions.
74 changes: 74 additions & 0 deletions data/campaigns/Wings_of_Victory/_main.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#textdomain wesnoth-wov
[textdomain]
name="wesnoth-wov"
[/textdomain]

# wmlscope: set export=no
[campaign]
id=Wings_of_Victory
name= _ "Wings of Victory"
abbrev= _ "WoV"
icon="units/drakes/inferno-fly-2-upstroke.png~CROP(0,0,72,72)~RC(magenta>red)"
rank=120
start_year="5 YW"
end_year="6 YW"
define=CAMPAIGN_WINGS_OF_VICTORY
first_scenario="01_The_Hunt"
image="data/core/images/portraits/drakes/inferno.png~SCALE(350,350)"
description= _ "Seize, conquer, dominate, expand. That was ever the Way of the Drakes. But the Brothers of the Spiral Path have seen a vision: Irdya is made like an egg, and the day will come when there is no more world to conquer — and what of the Way then? There was a drake named Galun on whom fell the burden of finding an answer...
" + _ "(Intermediate level, 11 scenarios.)" + "
" + _ "Version:" + " " + "{./dist/version}" + " " + "https://r.wesnoth.org/t49140"

{CAMPAIGN_DIFFICULTY EASY "units/drakes/burner-fly-1.png~CROP(0,0,72,72)~RC(magenta>red)" ( _ "Fledgling") ( _ "Normal")}
{CAMPAIGN_DIFFICULTY NORMAL "units/drakes/fire-fly-2-upstroke.png~CROP(0,0,72,72)~RC(magenta>red)" ( _ "Aspirant") ( _ "Challenging")} {DEFAULT_DIFFICULTY}
{CAMPAIGN_DIFFICULTY HARD "units/drakes/inferno-fly-5.png~CROP(0,0,72,72)~RC(magenta>red)" ( _ "Dominant") ( _ "Difficult")}

[about]
title= _ "Authors"
[entry]
name="Fabi/Fendrin"
[/entry]
[entry]
name="Eric S. Raymond (esr)"
[/entry]
[entry]
name = "Jeffrey 'Sigurd' Westcoat (SigurdFireDragon)"
[/entry]
[/about]
[about]
title = _ "Alpha Testing and Proofreading"
[entry]
name = "josteph"
[/entry]
[/about]
[about]
title = _ "Campaign Maintenance"
[entry]
name = "Jeffrey 'Sigurd' Westcoat (SigurdFireDragon)"
comment= "current maintainer"
[/entry]
[/about]
[about]
title= _ "Graphics"
[entry]
name="Shield"
comment="rabbit unit sprites"
[/entry]
[/about]
[/campaign]

#ifdef CAMPAIGN_WINGS_OF_VICTORY
[binary_path]
path=data/campaigns/Wings_of_Victory
[/binary_path]

{./utils}
{./scenarios}
[+units]
{./units}
[/units]
#endif

# wmllint: directory spellings Galun Vank Reshan'lo Morogor
# wmllint: directory spellings Kerath Vulcaniad Verkon
1 change: 1 addition & 0 deletions data/campaigns/Wings_of_Victory/dist/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0.0
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
69 changes: 69 additions & 0 deletions data/campaigns/Wings_of_Victory/lua/lua.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
-- from multiplayer/eras.lua, slightly modified

local res = {}

res.turns_over_advantage = function()
local _ = wesnoth.textdomain "wesnoth-multiplayer"
local function all_sides()
local function f(s, i)
i = i + 1
local t = wesnoth.sides[i]
return t and i, t
end
return f, nil, 0
end

local income_factor = 5

local winning_sides = {}
local tie = true
local total_score = -1
local side_comparison = ""
local color = "#000000"
for side, team in all_sides() do
if not team.__cfg.hidden then
local r, g, b = 255, 255, 255
if team.__cfg.color == 1 then r, g, b = 255, 0, 0
elseif team.__cfg.color == 2 then r, g, b = 0, 0, 255 end
if # wesnoth.get_units( { side = side } ) == 0 then
side_comparison = side_comparison .. string.format( tostring( _ "<span strikethrough='true' foreground='#%02x%02x%02x'>Side %d</span>") .. "\n",
r, g, b, side)
else
local income = team.total_income * income_factor
local units = 0
-- Calc the total unit-score here
for i, unit in ipairs( wesnoth.get_units { side = side } ) do
if not unit.__cfg.canrecruit then
wesnoth.fire("unit_worth", { id = unit.id })
units = units + wml.variables["unit_worth"]
end
end
-- Up to here
local total = units + team.gold + income
side_comparison = side_comparison .. string.format( tostring( _ "<span foreground='#%02x%02x%02x'>Side %d</span>: Income score = %d Unit score = %d Gold = %d") .. "\n" .. tostring( _ "Grand total: <b>%d</b>") .. "\n",
r, g, b, side, income, units, team.gold, total)
if total > total_score then
color = string.format("#%02x%02x%02x", r, g, b)
winning_sides = {side}
tie = false
total_score = total
elseif total == total_score then
table.insert(winning_sides, side)
tie = true
end
end
end
end

local result = nil
if tie then
side_comparison = side_comparison .. string.format( "\n" .. tostring( _ "Sides %s and %d are tied."), 1 , 2)
result = "tie"
else
side_comparison = side_comparison .. string.format( "\n" .. tostring( _ "<span foreground='%s'>Side %d</span> has the advantage."), color, winning_sides[1])
result = winning_sides[1]
end
wesnoth.fire("message", { message = side_comparison, speaker = "narrator", image = "wesnoth-icon.png"})
return result
end
return res
Loading

0 comments on commit 1141a07

Please sign in to comment.