Colored lights
The color of object lights can now be changed. This includes the following changes:
- added light test scenario, based on DarkCastle, with some lights,
- new functions SetLightColor() and GetLightColor() with C4Script documentation,
- third drawing pass for rendering the light color, the drawing passes are now referenced by enum,
- the blending of light from multiple colored light sources works correctly with alpha blending,
- light color value affects the intensity of the light,
- alpha blending of the light depends on color value and lightness. This means that brighter (= more value) and lighter (= more whiteish) light will be preferred in blending over other lights,
- the object light color is rendered to the lower half of the fow light texture now,
- the shader accesses the brightness/direction information and color information correctly,
The patch was created from the following commits:
dab898a SetLightColor()
f57286e Color texture experiment
d0702f5 Dynamic color
fa14cdf Light test scenario
f99203d Alternate lights
474bade Bugfixes
3113698 Brightness handled better
516fb21 GetLightColor
1d91ec9 Improvements
3cfbf6c Documentation
95ec185 Improvements: Light Shader
a63bffc Scope of alpha
20c7ca0 Improvement: C4FoWLight
17d9123 Undo code style
d79411b Cleaner code
(cherry picked from commit 36dec610e36860b88417e91ce727250673bc2ec2)
Conflicts:
src/landscape/fow/C4FoWRegion.cpp, merged
2015-06-28 18:58:53 +00:00
|
|
|
/**
|
|
|
|
Evil Castle
|
|
|
|
Desc
|
|
|
|
|
|
|
|
@authors Sven2
|
|
|
|
*/
|
|
|
|
|
|
|
|
static g_is_initialized;
|
|
|
|
|
|
|
|
static g_ruin1, g_ruin2, g_ruin3, g_elev1, g_elev2, g_farmer, g_king;
|
|
|
|
static npc_pyrit, g_cannon, g_cannoneer;
|
|
|
|
|
|
|
|
func DoInit(int first_player)
|
|
|
|
{
|
|
|
|
// Message when first player enters shroom area
|
|
|
|
ScheduleCall(nil, Scenario.ShroomCaveCheck, 21, 0xffffff);
|
|
|
|
// Scorching village
|
|
|
|
g_ruin1->AddScorch(-20,-10, -45, 50, 1500);
|
|
|
|
g_ruin2->AddScorch(-15,42, 90, 50, 1200);
|
|
|
|
g_ruin3->AddScorch(-12,18, 130, 80, 1300);
|
|
|
|
// Update AI stuff
|
|
|
|
var fx;
|
|
|
|
for (var enemy in FindObjects(Find_ID(Clonk), Find_Owner(NO_OWNER)))
|
2015-10-14 16:57:36 +00:00
|
|
|
if (fx = AI->GetAI(enemy))
|
Colored lights
The color of object lights can now be changed. This includes the following changes:
- added light test scenario, based on DarkCastle, with some lights,
- new functions SetLightColor() and GetLightColor() with C4Script documentation,
- third drawing pass for rendering the light color, the drawing passes are now referenced by enum,
- the blending of light from multiple colored light sources works correctly with alpha blending,
- light color value affects the intensity of the light,
- alpha blending of the light depends on color value and lightness. This means that brighter (= more value) and lighter (= more whiteish) light will be preferred in blending over other lights,
- the object light color is rendered to the lower half of the fow light texture now,
- the shader accesses the brightness/direction information and color information correctly,
The patch was created from the following commits:
dab898a SetLightColor()
f57286e Color texture experiment
d0702f5 Dynamic color
fa14cdf Light test scenario
f99203d Alternate lights
474bade Bugfixes
3113698 Brightness handled better
516fb21 GetLightColor
1d91ec9 Improvements
3cfbf6c Documentation
95ec185 Improvements: Light Shader
a63bffc Scope of alpha
20c7ca0 Improvement: C4FoWLight
17d9123 Undo code style
d79411b Cleaner code
(cherry picked from commit 36dec610e36860b88417e91ce727250673bc2ec2)
Conflicts:
src/landscape/fow/C4FoWRegion.cpp, merged
2015-06-28 18:58:53 +00:00
|
|
|
{
|
|
|
|
fx.weapon = fx.target = nil;
|
2015-10-14 16:57:36 +00:00
|
|
|
AI->BindInventory(enemy);
|
Colored lights
The color of object lights can now be changed. This includes the following changes:
- added light test scenario, based on DarkCastle, with some lights,
- new functions SetLightColor() and GetLightColor() with C4Script documentation,
- third drawing pass for rendering the light color, the drawing passes are now referenced by enum,
- the blending of light from multiple colored light sources works correctly with alpha blending,
- light color value affects the intensity of the light,
- alpha blending of the light depends on color value and lightness. This means that brighter (= more value) and lighter (= more whiteish) light will be preferred in blending over other lights,
- the object light color is rendered to the lower half of the fow light texture now,
- the shader accesses the brightness/direction information and color information correctly,
The patch was created from the following commits:
dab898a SetLightColor()
f57286e Color texture experiment
d0702f5 Dynamic color
fa14cdf Light test scenario
f99203d Alternate lights
474bade Bugfixes
3113698 Brightness handled better
516fb21 GetLightColor
1d91ec9 Improvements
3cfbf6c Documentation
95ec185 Improvements: Light Shader
a63bffc Scope of alpha
20c7ca0 Improvement: C4FoWLight
17d9123 Undo code style
d79411b Cleaner code
(cherry picked from commit 36dec610e36860b88417e91ce727250673bc2ec2)
Conflicts:
src/landscape/fow/C4FoWRegion.cpp, merged
2015-06-28 18:58:53 +00:00
|
|
|
enemy->DoEnergy(10000);
|
|
|
|
enemy->AddEnergyBar();
|
|
|
|
}
|
2017-03-30 18:51:22 +00:00
|
|
|
|
|
|
|
GetRelaunchRule()
|
|
|
|
->SetBaseRespawn(true)
|
|
|
|
->SetInventoryTransfer(true)
|
|
|
|
->SetFreeCrew(true);
|
Colored lights
The color of object lights can now be changed. This includes the following changes:
- added light test scenario, based on DarkCastle, with some lights,
- new functions SetLightColor() and GetLightColor() with C4Script documentation,
- third drawing pass for rendering the light color, the drawing passes are now referenced by enum,
- the blending of light from multiple colored light sources works correctly with alpha blending,
- light color value affects the intensity of the light,
- alpha blending of the light depends on color value and lightness. This means that brighter (= more value) and lighter (= more whiteish) light will be preferred in blending over other lights,
- the object light color is rendered to the lower half of the fow light texture now,
- the shader accesses the brightness/direction information and color information correctly,
The patch was created from the following commits:
dab898a SetLightColor()
f57286e Color texture experiment
d0702f5 Dynamic color
fa14cdf Light test scenario
f99203d Alternate lights
474bade Bugfixes
3113698 Brightness handled better
516fb21 GetLightColor
1d91ec9 Improvements
3cfbf6c Documentation
95ec185 Improvements: Light Shader
a63bffc Scope of alpha
20c7ca0 Improvement: C4FoWLight
17d9123 Undo code style
d79411b Cleaner code
(cherry picked from commit 36dec610e36860b88417e91ce727250673bc2ec2)
Conflicts:
src/landscape/fow/C4FoWRegion.cpp, merged
2015-06-28 18:58:53 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
func InitializePlayer(int plr)
|
|
|
|
{
|
|
|
|
// Players only
|
|
|
|
if (GetPlayerType(plr)!=C4PT_User) return;
|
|
|
|
// Scenario init
|
|
|
|
if (!g_is_initialized) g_is_initialized = DoInit(plr);
|
|
|
|
// Harsh zoom range
|
|
|
|
for (var flag in [PLRZOOM_LimitMax, PLRZOOM_Direct])
|
|
|
|
SetPlayerZoomByViewRange(plr,400,250,flag);
|
|
|
|
SetPlayerViewLock(plr, true);
|
|
|
|
// Initial join
|
|
|
|
var crew = GetCrew(plr);
|
|
|
|
crew->SetPosition(35 + Random(10) , 1140);
|
|
|
|
crew->SetDir(DIR_Right);
|
|
|
|
crew->CreateContents(Shovel);
|
|
|
|
crew->CreateContents(Hammer);
|
|
|
|
crew->CreateContents(Axe);
|
|
|
|
crew->SetLightRange(100, 80);
|
|
|
|
crew->SetLightColor(RGB(0,0,200));
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Mushroom cave encounter */
|
|
|
|
|
|
|
|
func ShroomCaveCheck()
|
|
|
|
{
|
|
|
|
var intruder = FindObject(Find_InRect(1252,1342,320,138), Find_OCF(OCF_CrewMember));
|
|
|
|
if (!intruder) return true;
|
|
|
|
ClearScheduleCall(nil, Scenario.ShroomCaveCheck);
|
|
|
|
return true;
|
|
|
|
}
|