Skip to content

Commit

Permalink
Moved the wood pile definition to GSML
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrettin committed Jun 27, 2022
1 parent 7f896c2 commit 426f30d
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 77 deletions.
40 changes: 40 additions & 0 deletions data/unit_types/resources/wood_pile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
unit_wood_pile = {
name = "Wood Pile"
image_file = "neutral/buildings/wood_pile_1.png"
frame_size = { 43 43 }
animation_set = animations_building
icon = icon_lumber
neutral_minimap_color = { 165 42 42 }
hit_points = 25500
draw_level = 30
tile_size = { 1 1 }
box_size = { 36 36 }
sight_range = 1
armor = 20
missile = missile_none
priority = 0
domain = land
starting_resources = 400
num_directions = 1
building = false
visible_under_fog = true
can_harvest = true
harvest_from_outside = true
given_resource = lumber
variations = {
1 = {
}
2 = {
image_file = "neutral/buildings/wood_pile_2.png"
}
3 = {
image_file = "neutral/buildings/wood_pile_3.png"
}
4 = {
image_file = "neutral/buildings/wood_pile_4.png"
}
}
sounds = {
selected = tree_selected
}
}
2 changes: 1 addition & 1 deletion scripts/civilizations/dwarf/units.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1997,7 +1997,7 @@ DefineUnitType("unit-dwarven-mushroom-farm", {
Costs = {"lumber", 0, "stone", 750},
RepairCosts = {"lumber", 0, "stone", 1},
FireResistance = 20,
Drops = {"unit-wood-pile", "unit_stone_pile"},
Drops = {"unit_wood_pile", "unit_stone_pile"},
Variations = {
{
"variation-id", "mushroom-farm",
Expand Down
16 changes: 8 additions & 8 deletions scripts/map_generation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1933,9 +1933,9 @@ function CreatePlayers(min_x, max_x, min_y, max_y, town_halls, symmetric, starti
CreateStartingGoldMine(i, nil, nil, true) -- create the player's gold mine
if (GetPlayerData(i, "RaceName") == "dwarf") then
CreateStartingLocationResourcePiles(i, "unit_stone_pile", 12)
CreateStartingLocationResourcePiles(i, "unit-wood-pile", 4)
CreateStartingLocationResourcePiles(i, "unit_wood_pile", 4)
else
CreateStartingLocationResourcePiles(i, "unit-wood-pile", 16)
CreateStartingLocationResourcePiles(i, "unit_wood_pile", 16)
end
else
for sub_x=-1,4 do
Expand Down Expand Up @@ -2328,9 +2328,9 @@ function GenerateRandomMap(arg)
if (GetPlayerData(i, "Type") == PlayerPerson or GetPlayerData(i, "Type") == PlayerComputer) then
if (GetPlayerData(i, "RaceName") == "dwarf") then
CreateStartingLocationResourcePiles(i, "unit_stone_pile", 12)
CreateStartingLocationResourcePiles(i, "unit-wood-pile", 4)
CreateStartingLocationResourcePiles(i, "unit_wood_pile", 4)
else
CreateStartingLocationResourcePiles(i, "unit-wood-pile", 16)
CreateStartingLocationResourcePiles(i, "unit_wood_pile", 16)
end
end
end
Expand Down Expand Up @@ -2444,7 +2444,7 @@ function ApplyRawTiles()
end
elseif (RawTile(x, y) == "Tree" and (GetCurrentTileset() == "cave" or GetCurrentTileset() == "dungeon")) then -- if the cave or dungeon tileset is being used, then the trees are wood pile objects instead, and the tile is set to buildable land
SetRawTile(x, y, "Land")
unit = CreateUnit("unit-wood-pile", PlayerNumNeutral, {x, y})
unit = CreateUnit("unit_wood_pile", PlayerNumNeutral, {x, y})
elseif (RawTile(x, y) == "Door") then
SetRawTile(x, y, "Land")
unit = CreateUnit("unit-door", PlayerNumNeutral, {x, y})
Expand Down Expand Up @@ -3153,7 +3153,7 @@ function AdjustRawMapTileIrregularities(min_x, max_x, min_y, max_y, count, adjus
end
elseif (RawTile(x, y) == "Tree" and GetCurrentTileset() == "cave" or GetCurrentTileset() == "dungeon") then -- if the cave or dungeon tileset is being used, then the trees are wood pile objects instead, and the tile is set to buildable land
SetRawTile(x, y, "Land")
unit = CreateUnit("unit-wood-pile", PlayerNumNeutral, {x, y})
unit = CreateUnit("unit_wood_pile", PlayerNumNeutral, {x, y})
end
end
end
Expand Down Expand Up @@ -4070,9 +4070,9 @@ function GenerateValley(direction, lake_quantity)
if (GetPlayerData(i, "Type") == PlayerPerson or GetPlayerData(i, "Type") == PlayerComputer) then
if (GetPlayerData(i, "RaceName") == "dwarf") then
CreateStartingLocationResourcePiles(i, "unit_stone_pile", 12)
CreateStartingLocationResourcePiles(i, "unit-wood-pile", 4)
CreateStartingLocationResourcePiles(i, "unit_wood_pile", 4)
else
CreateStartingLocationResourcePiles(i, "unit-wood-pile", 16)
CreateStartingLocationResourcePiles(i, "unit_wood_pile", 16)
end
end
end
Expand Down
16 changes: 8 additions & 8 deletions scripts/map_templates.lua
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ DefineMapTemplate("island-of-the-lizard-god", {
},
PlayerLocationGeneratedNeutralUnits = {
"unit_copper_deposit", 1,
"unit-wood-pile", 16,
"unit_wood_pile", 16,
"unit_stone_pile", 16
}
})
Expand All @@ -58,18 +58,18 @@ DefineMapTemplate("island-of-the-lizard-god-underground", {
SubtemplatePositionTopLeft = {748, 536},
GeneratedNeutralUnits = {
"unit_copper_deposit", 1,
"unit-wood-pile", 32,
"unit-wood-pile", 32,
"unit-wood-pile", 32,
"unit-wood-pile", 32,
"unit-wood-pile", 32,
"unit-wood-pile", 32,
"unit_wood_pile", 32,
"unit_wood_pile", 32,
"unit_wood_pile", 32,
"unit_wood_pile", 32,
"unit_wood_pile", 32,
"unit_wood_pile", 32,
"unit-snigill", 8,
"unit-slime", 4
},
PlayerLocationGeneratedNeutralUnits = {
"unit_copper_deposit", 1,
"unit-wood-pile", 16,
"unit_wood_pile", 16,
"unit_stone_pile", 16
}
})
2 changes: 1 addition & 1 deletion scripts/stratagus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,7 @@ function StandardTriggers()
if (GetArrayIncludes(wyr.preferences.TipsShown, "Wood Pile") == false) then
AddTrigger("tip-wood-pile",
function()
if (table.getn(GetSelectedUnits()) > 0 and GetUnitVariable(GetSelectedUnits()[1], "Ident") == "unit-wood-pile") then
if (table.getn(GetSelectedUnits()) > 0 and GetUnitVariable(GetSelectedUnits()[1], "Ident") == "unit_wood_pile") then
return true
else
return false
Expand Down
74 changes: 15 additions & 59 deletions scripts/units.lua
Original file line number Diff line number Diff line change
Expand Up @@ -763,50 +763,6 @@ DefineUnitType("unit-emerald-rock", {
}
} )

DefineUnitType("unit-wood-pile", {
Name = "Wood Pile",
Image = {"file", "neutral/buildings/wood_pile_1.png", "size", {43, 43}},
Animations = "animations-building", Icon = "icon_lumber",
NeutralMinimapColor = {165, 42, 42},
Costs = {"time", 150},
HitPoints = 25500,
DrawLevel = 30,
TileSize = {1, 1}, BoxSize = {36, 36},
SightRange = 1,
Armor = 20, Missile = "missile-none",
Priority = 0,
-- Corpse = "unit-destroyed-3x3-place",
Domain = "land",
StartingResources = {400},
NumDirections = 1,
Building = false, VisibleUnderFog = true,
GivesResource = "lumber", CanHarvest = true,
HarvestFromOutside = true,
Variations = {
{
"variation-id", "1"
},
{
"variation-id", "2",
"file", "neutral/buildings/wood_pile_2.png"
},
{
"variation-id", "3",
"file", "neutral/buildings/wood_pile_3.png"
},
{
"variation-id", "4",
"file", "neutral/buildings/wood_pile_4.png"
}
},
Sounds = {
"selected", "tree-selected",
-- "acknowledge", "gold-mine-acknowledge",
-- "ready", "gold-mine-ready",
-- "dead", "building-destroyed"
}
} )

DefineUnitType("unit-template-lair", {
Name = "Lair",
Parent = "unit-template-base-deposit",
Expand Down Expand Up @@ -3920,7 +3876,7 @@ DefineUnitType("unit-template-town-hall", {
RecruitHeroes = true,
IncreasesLuxuryDemand = true,
CanStore = {"copper", "silver", "gold", "iron", "mithril", "lumber", "stone", "limestone", "coal", "jewelry", "furniture", "leather", "diamonds", "emeralds"},
Drops = {"unit-wood-pile"},
Drops = {"unit_wood_pile"},
RightMouseAction = "rally_point",
BurnPercent = 50,
BurnDamageRate = 1,
Expand Down Expand Up @@ -4003,7 +3959,7 @@ DefineUnitType("unit-template-farm", {
Supply = 4,
-- HydratingAura = 1,
ExplodeWhenKilled = "missile-explosion",
Drops = {"unit-cheese", "unit-carrots", "unit_meat", "unit-wood-pile"},
Drops = {"unit-cheese", "unit-carrots", "unit_meat", "unit_wood_pile"},
Domain = "land",
BuilderOutside = true,
IncreasesLuxuryDemand = true,
Expand Down Expand Up @@ -4047,7 +4003,7 @@ DefineUnitType("unit-template-barracks", {
IncreasesLuxuryDemand = true,
GarrisonTraining = true,
NeutralHostile = true,
Drops = {"unit-wood-pile"},
Drops = {"unit_wood_pile"},
RightMouseAction = "rally_point",
CostModifier = 25,
BurnPercent = 50,
Expand Down Expand Up @@ -4095,7 +4051,7 @@ DefineUnitType("unit-template-lumber-mill", {
IncreasesLuxuryDemand = true,
NeutralHostile = true,
MaxHarvesters = 5,
Drops = {"unit-wood-pile"},
Drops = {"unit_wood_pile"},
CostModifier = 25,
BurnPercent = 50,
BurnDamageRate = 1,
Expand Down Expand Up @@ -4148,7 +4104,7 @@ DefineUnitType("unit-template-smithy", {
NeutralHostile = true,
MaxHarvesters = 5,
CanStore = {"copper", "silver", "gold", "iron", "mithril", "coal", "diamonds", "emeralds"},
Drops = {"unit-wood-pile"},
Drops = {"unit_wood_pile"},
CostModifier = 25,
BurnPercent = 50,
BurnDamageRate = 1,
Expand Down Expand Up @@ -4214,7 +4170,7 @@ DefineUnitType("unit-template-masons-shop", {
BuilderOutside = true,
IncreasesLuxuryDemand = true,
MaxHarvesters = 5,
Drops = {"unit-wood-pile", "unit_stone_pile"},
Drops = {"unit_wood_pile", "unit_stone_pile"},
CostModifier = 25,
BurnPercent = 50,
BurnDamageRate = 1,
Expand Down Expand Up @@ -4255,7 +4211,7 @@ DefineUnitType("unit-template-stables", {
Domain = "land",
BuilderOutside = true,
IncreasesLuxuryDemand = true,
Drops = {"unit-wood-pile"},
Drops = {"unit_wood_pile"},
CostModifier = 25,
BurnPercent = 50,
BurnDamageRate = 1,
Expand Down Expand Up @@ -4291,7 +4247,7 @@ DefineUnitType("unit-template-temple", {
BuilderOutside = true,
IncreasesLuxuryDemand = true,
RightMouseAction = "rally_point",
Drops = {"unit-wood-pile"},
Drops = {"unit_wood_pile"},
CostModifier = 25,
BurnPercent = 50,
BurnDamageRate = 1,
Expand Down Expand Up @@ -4335,7 +4291,7 @@ DefineUnitType("unit-template-university", {
BuilderOutside = true,
IncreasesLuxuryDemand = true,
RightMouseAction = "rally_point",
Drops = {"unit-wood-pile"},
Drops = {"unit_wood_pile"},
CostModifier = 25,
BurnPercent = 50,
BurnDamageRate = 1,
Expand Down Expand Up @@ -4382,7 +4338,7 @@ DefineUnitType("unit-template-watch-tower", {
SaveCargo = true,
BuilderOutside = true,
NeutralHostile = true,
Drops = {"unit-wood-pile", "unit_stone_pile"},
Drops = {"unit_wood_pile", "unit_stone_pile"},
-- RightMouseAction = "attack",
BurnPercent = 50,
BurnDamageRate = 1,
Expand Down Expand Up @@ -4433,7 +4389,7 @@ DefineUnitType("unit-template-guard-tower", {
SaveCargo = true,
PierceDamage = true,
NeutralHostile = true,
Drops = {"unit-wood-pile", "unit_stone_pile"},
Drops = {"unit_wood_pile", "unit_stone_pile"},
BurnPercent = 50,
BurnDamageRate = 1,
RequirementsString = "Lumber Mill and Masonry",
Expand Down Expand Up @@ -4478,7 +4434,7 @@ DefineUnitType("unit-template-heavy-tower", {
CanTargetLand = true, CanTargetSea = true,
DetectCloak = true,
NeutralHostile = true,
Drops = {"unit-wood-pile", "unit_stone_pile"},
Drops = {"unit_wood_pile", "unit_stone_pile"},
BurnPercent = 50,
BurnDamageRate = 1,
RequirementsString = "Lumber Mill, Smithy, Engineering and Masonry",
Expand Down Expand Up @@ -4538,7 +4494,7 @@ DefineUnitType("unit-template-market", {
CanHarvest = true,
Inexhaustible = true,
StartingResources = {1000},
Drops = {"unit-wood-pile"},
Drops = {"unit_wood_pile"},
RightMouseAction = "rally_point",
CostModifier = 25,
BurnPercent = 50,
Expand Down Expand Up @@ -4592,7 +4548,7 @@ DefineUnitType("unit-template-dock", {
Inexhaustible = true,
IncreasesLuxuryDemand = true,
StartingResources = {1000},
-- Drops = {"unit-wood-pile"},
-- Drops = {"unit_wood_pile"},
RightMouseAction = "rally_point",
CostModifier = 25,
BurnPercent = 50,
Expand Down Expand Up @@ -4834,7 +4790,7 @@ DefineUnitType("unit-mercenary-camp", {
Corpse = "unit-destroyed-3x3-place",
ExplodeWhenKilled = "missile-explosion",
Domain = "land",
Drops = {"unit-wood-pile"},
Drops = {"unit_wood_pile"},
RightMouseAction = "rally_point",
BurnPercent = 50,
BurnDamageRate = 1,
Expand Down

0 comments on commit 426f30d

Please sign in to comment.