forked from FAForever/fa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
temporarily add christmas objects to the game (FAForever#2338)
* temporarily add christmas objects to the game includes: props being replaced by gifts Santa hat on GC GC rename * bump version * add santa mod to blacklist * fix typo * add snowman * add normals for correct shadows * fix paths * increase size of snowman * change size of snowman * add more presents * add more santa mods to blacklist (temporarily) * add better snowman and christmas tree * add more versions to the blacklist * add santa hat to acus
- Loading branch information
1 parent
6d8ba34
commit f33e958
Showing
93 changed files
with
982 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
local ScenarioUtils = import('/lua/sim/ScenarioUtilities.lua') | ||
local ScenarioFramework = import('/lua/ScenarioFramework.lua') | ||
|
||
|
||
function Init() | ||
ForkThread(Create_Christmas_Presents) | ||
end | ||
|
||
|
||
function Create_Christmas_Presents() | ||
math.randomseed(1) | ||
|
||
local ListOfProps = {} | ||
local posx, posy = GetMapSize() | ||
local Map_Area = { | ||
["x0"] = 0, | ||
["y0"] = 0, | ||
["x1"] = posx, | ||
["y1"] = posy | ||
} | ||
|
||
local i = 1 | ||
local allprops = GetReclaimablesInRect(Map_Area) | ||
local StoneName = {'rock', 'boulder', 'fieldstone', 'iceberg'} | ||
local number_of_props = table.getn(allprops) | ||
|
||
for _, r in allprops or {} do | ||
local replaceit = 0 | ||
local propbp = r:GetBlueprint() | ||
if propbp.ScriptClass == 'Tree' then | ||
replaceit = 0.035 | ||
elseif string.find(propbp.Interface.HelpText, 'Rock') then | ||
replaceit = 0.09 | ||
end | ||
if number_of_props > 0 then | ||
replaceit = replaceit * 10000/number_of_props | ||
end | ||
if (replaceit > 0) then | ||
if(math.random(100) < 100 * replaceit) then | ||
local prop = r | ||
ListOfProps[i] = prop | ||
r:Destroy() | ||
i = i + 1 | ||
end | ||
end | ||
end | ||
|
||
local color_gifts = {'blue', 'green', 'green2', 'pink', 'red', 'yellow','snowflake', 'owl', 'star'} | ||
local new_props = {} | ||
new_props[table.getn(new_props)+ 1] = '/props/snowman/snowman_prop.bp' | ||
for _, color in color_gifts do | ||
new_props[table.getn(new_props)+1] = '/props/gift_' .. color .. '/gift_' .. color .. '_prop.bp' | ||
end | ||
for k = 1, 3 do | ||
new_props[table.getn(new_props)+ 1] = '/props/cookie/cookie_prop.bp' | ||
end | ||
|
||
for _, present in ListOfProps or {} do | ||
local proptype = math.ceil(math.random(table.getn(new_props))) | ||
local NewGift = CreateProp( VECTOR3(present:GetPosition()['x'], | ||
present:GetPosition()['y'], | ||
present:GetPosition()['z'] ), | ||
new_props[proptype]) | ||
|
||
-- set the reclaim values to match the removed prop | ||
NewGift:SetMaxReclaimValues( 5, present:GetBlueprint().Economy.ReclaimMassMax, present:GetBlueprint().Economy.ReclaimEnergyMax) | ||
-- determine the new size of the prop | ||
local new_size = ( (present:GetBlueprint().Economy.ReclaimMassMax + present:GetBlueprint().Economy.ReclaimEnergyMax/10 + math.random(25)) ) -- + | ||
-- map the size of the prop into the allowed range | ||
new_size = 0.02 + 0.064*(new_size-3)/135 | ||
if(new_size < 0.02) then | ||
new_size = 0.02 | ||
elseif (new_size > 0.084) then | ||
new_size = 0.084 | ||
end | ||
if proptype == 1 then | ||
new_size = 100 * new_size | ||
end | ||
NewGift:SetScale(new_size*0.7) | ||
|
||
local orient = math.random(628)/100-3.14 | ||
local vec = VECTOR3(math.cos(orient),0,math.sin(orient)) | ||
NewGift:SetOrientation(OrientFromDir( vec ), true) | ||
end | ||
|
||
-- create christmas tree | ||
if GetSurfaceHeight(posx/2,posy/2) == GetTerrainHeight(posx/2,posy/2) then | ||
local christmasTree = CreateProp( VECTOR3(posx/2, | ||
GetTerrainHeight(posx/2,posy/2), | ||
posy/2 ), | ||
'/props/christmastree/christmastree_prop.bp') | ||
christmasTree:SetMaxReclaimValues( 10, 1, 1) | ||
christmasTree:SetScale(0.24) | ||
|
||
local orient = math.random(628)/100-3.14 | ||
local vec = VECTOR3(math.cos(orient),0,math.sin(orient)) | ||
christmasTree:SetOrientation(OrientFromDir( vec ), true) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
PropBlueprint { | ||
Categories = { | ||
'RECLAIMABLE', | ||
}, | ||
Defense = { | ||
Health = 50, | ||
MaxHealth = 50, | ||
}, | ||
Display = { | ||
Mesh = { | ||
IconFadeInZoom = 4, | ||
LODs = { | ||
{ | ||
AlbedoName = [[/props/christmastree/christmastree_albedo.dds]], | ||
LODCutoff = 500, | ||
ShaderName = 'VertexNormal', | ||
}, | ||
}, | ||
}, | ||
UniformScale = 0.051, | ||
}, | ||
Economy = { | ||
ReclaimEnergyMax = 0, | ||
ReclaimMassMax = 0, | ||
ReclaimTime = 5, | ||
}, | ||
Footprint = { | ||
OccupancyCaps = 3, | ||
}, | ||
Interface = { | ||
HelpText = 'Large Rock', | ||
}, | ||
Physics = { | ||
BlockPath = false, | ||
}, | ||
SizeX = 2, | ||
SizeY = 1, | ||
SizeZ = 5, | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
PropBlueprint { | ||
Categories = { | ||
'RECLAIMABLE', | ||
}, | ||
Defense = { | ||
Health = 50, | ||
MaxHealth = 50, | ||
}, | ||
Display = { | ||
Mesh = { | ||
IconFadeInZoom = 4, | ||
LODs = { | ||
{ | ||
AlbedoName = [[/props/cookie/cookie_albedo.dds]], | ||
LODCutoff = 500, | ||
ShaderName = 'NormalMappedTerrain', | ||
}, | ||
}, | ||
}, | ||
UniformScale = 0.051, | ||
}, | ||
Economy = { | ||
ReclaimEnergyMax = 0, | ||
ReclaimMassMax = 0, | ||
ReclaimTime = 5, | ||
}, | ||
Footprint = { | ||
OccupancyCaps = 3, | ||
}, | ||
Interface = { | ||
HelpText = 'Large Rock', | ||
}, | ||
Physics = { | ||
BlockPath = false, | ||
}, | ||
SizeX = 2, | ||
SizeY = 1, | ||
SizeZ = 5, | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
PropBlueprint { | ||
Categories = { | ||
'RECLAIMABLE', | ||
}, | ||
Defense = { | ||
Health = 50, | ||
MaxHealth = 50, | ||
}, | ||
Display = { | ||
Mesh = { | ||
IconFadeInZoom = 4, | ||
LODs = { | ||
{ | ||
AlbedoName = [[/props/gift_blue/gift_blue_albedo.dds]], | ||
LODCutoff = 500, | ||
ShaderName = 'NormalMappedTerrain', | ||
}, | ||
}, | ||
}, | ||
UniformScale = 0.051, | ||
}, | ||
Economy = { | ||
ReclaimEnergyMax = 0, | ||
ReclaimMassMax = 0, | ||
ReclaimTime = 5, | ||
}, | ||
Footprint = { | ||
OccupancyCaps = 3, | ||
}, | ||
Interface = { | ||
HelpText = 'Large Rock', | ||
}, | ||
Physics = { | ||
BlockPath = false, | ||
}, | ||
SizeX = 2, | ||
SizeY = 1, | ||
SizeZ = 5, | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
PropBlueprint { | ||
Categories = { | ||
'RECLAIMABLE', | ||
}, | ||
Defense = { | ||
Health = 50, | ||
MaxHealth = 50, | ||
}, | ||
Display = { | ||
Mesh = { | ||
IconFadeInZoom = 4, | ||
LODs = { | ||
{ | ||
AlbedoName = [[/props/gift_green/gift_green.dds]], | ||
LODCutoff = 500, | ||
ShaderName = 'NormalMappedTerrain', | ||
}, | ||
}, | ||
}, | ||
UniformScale = 0.051, | ||
}, | ||
Economy = { | ||
ReclaimEnergyMax = 0, | ||
ReclaimMassMax = 0, | ||
ReclaimTime = 5, | ||
}, | ||
Footprint = { | ||
OccupancyCaps = 3, | ||
}, | ||
Interface = { | ||
HelpText = 'Large Rock', | ||
}, | ||
Physics = { | ||
BlockPath = false, | ||
}, | ||
SizeX = 3, | ||
SizeY = 3, | ||
SizeZ = 3, | ||
} |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Oops, something went wrong.