Merge branch 'norefs'

Conflicts:
	planet/Melees.c4f/Ruins.c4s/ObjectFade.c4d/Script.c
	planet/Objects.c4d/Goals.c4d/KingOfTheHill.c4d/Script.c
	planet/Objects.c4d/Goals.c4d/LastManStanding.c4d/Relaunch.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/BlackPowder.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Coal.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Earth.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Firestone.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Gold.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Ice.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Loam.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Metal.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Ore.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Rock.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Snow.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Sulphur.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Resources.c4d/Wood.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Axe.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Balloon.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Barrel.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Boompack.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/PowerLine.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/CableReel.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Dynamite.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Fuse.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Igniter.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/DynamiteBox.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/GrappleBow.c4d/Hook.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/GrappleBow.c4d/Rope.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/GrappleBow.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Hammer.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/JarOfWinds.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/OrbOfTelekinesis.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Pickaxe.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/PowderKeg.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Ropeladder.c4d/LadderGrabber.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Ropeladder.c4d/LadderSegment.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Ropeladder.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Tools.c4d/Shovel.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Weapons.c4d/Bow.c4d/Arrow.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Weapons.c4d/Bow.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Weapons.c4d/Club.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Weapons.c4d/Javelin.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Ammo.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Weapons.c4d/Musket.c4d/Script.c
	planet/Objects.c4d/Items.c4d/Weapons.c4d/Shield.c4d/Script.c
	planet/Objects.c4d/Vehicles.c4d/Cannon.c4d/Script.c
	planet/Objects.c4d/Vehicles.c4d/Lorry.c4d/Script.c
	planet/Tutorial.c4f/Tutorial.c4d/FlagGoal.c4d/Flag.c4d/Script.c
	planet/Tutorial.c4f/Tutorial.c4d/FlagGoal.c4d/Script.c
	planet/Tutorial.c4f/Tutorial.c4d/MenuDeco.c4d/Script.c
	planet/Tutorial.c4f/Tutorial.c4d/ObjectRestorer.c4d/Script.c
	planet/Tutorial.c4f/Tutorial.c4d/TutGuide.c4d/Script.c
	planet/Tutorial.c4f/Tutorial.c4d/TutorialGoal.c4d/Script.c
	planet/Tutorial.c4f/Tutorial03.c4s/ShootTheTargets.c4d/Script.c
	src/game/object/C4Def.h
Günther Brammer 2010-09-11 19:30:45 +02:00
commit cf92ceae2d
142 changed files with 1462 additions and 1869 deletions

View File

@ -18,8 +18,7 @@ stamp-h1
config.h
config.log
config.status
hgrevision.h
hgrevision
C4Version.h
Makefile
C4Include.h.gch
Makefile.in

View File

@ -61,6 +61,4 @@ public func FxIntFadeOutTimerEffect(string new_effect_name) {
return -1;
}
func Definition(def) {
SetProperty("Name", "Object Fade", def);
}
local Name = "Object Fade";

View File

@ -91,8 +91,7 @@ private func GetHorizonHeight(int x)
return height;
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Fly = {
Prototype = Action,
@ -126,8 +125,9 @@ Flutter = {
StartCall = "Fluttering",
Animation = "Wait",
},
}, def);
SetProperty("Name", "Butterfly", def);
};
local Name = "Butterfly";
func Definition(def) {
SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(20,1,0,0),Trans_Rotate(70,0,1,0)), def);
}

View File

@ -223,8 +223,7 @@ protected func ContainedDigDouble()
return 1;
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Walk = {
Prototype = Action,
Name = "Walk",
@ -405,6 +404,5 @@ Dead = {
ObjectDisabled = 1,
Animation = "Death",
},
}, def);
SetProperty("Name", "$Name$", def);
}
};
local Name = "$Name$";

View File

@ -1759,9 +1759,7 @@ protected func AbortHangOnto()
/* Act Map */
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Walk = {
Prototype = Action,
Name = "Walk",
@ -1849,7 +1847,7 @@ Dig = {
Procedure = DFA_DIG,
Directions = 2,
Length = 16,
Delay = 15*3*0,
Delay = 0,//15*3*0,
X = 0,
Y = 60,
Wdt = 8,
@ -2016,9 +2014,10 @@ HangOnto = {
AbortCall = "AbortHangOnto",
InLiquidAction = "Swim",
},
}, def);
SetProperty("Name", "Clonk", def);
};
local Name = "Clonk";
func Definition(def) {
// Set perspective
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(0,1000,5000), Trans_Rotate(70,0,1,0)), def);

View File

@ -38,15 +38,13 @@ func UpdateTransferZone()
Show();
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Fly = {
Prototype = Action,
Name = "Fly",
Procedure = DFA_FLOAT,
NextAction = "Hold"
},
}, def);
SetProperty("Name", "Cloud", def);
}
};
local Name = "Cloud";

View File

@ -59,14 +59,13 @@ public func AttachTargetLost()
RemoveObject();
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Attach = {
Prototype = Action,
Name = "Attach",
Procedure = DFA_ATTACH,
Length = 1,
Delay = 0,
}, }, def);
SetProperty("Name", "$Name$", def);
}
},
};
local Name = "$Name$";

View File

@ -1,4 +1 @@
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -167,5 +167,5 @@ Fly = {
TurnAction = "Turn",
},
}, def);
SetProperty("Name", "Cloud", def);
}
local Name = "Cloud";

View File

@ -40,11 +40,11 @@ protected func FxLightningMoveTimer()
var newy = oldy + yDir + yDev - Random(2 * yDev);
var pathCheckX = oldx+GetX(), pathCheckY = oldy+GetY();
//Log("Lightning %d: Moving from %d/%d to %d/%d", ObjectNumber(), pathCheckX, pathCheckY, newx+GetX(), newy+GetY());
var strike_solid = !PathFree2(pathCheckX, pathCheckY, newx+GetX(), newy+GetY());
var strike_solid = PathFree2(pathCheckX, pathCheckY, newx+GetX(), newy+GetY());
if (strike_solid)
{
newx = pathCheckX - GetX();
newy = pathCheckY - GetY();
newx = strike_solid[0] - GetX();
newy = strike_solid[1] - GetY();
//Log("Lightning %d: Move blocked, moving to %d/%d instead", ObjectNumber(), newx+GetX(), newy+GetY());
}
AddVertex(newx, newy);
@ -97,7 +97,4 @@ private func DrawRotatedParticleLine(string particle, int x1, int y1, int x2, in
}
}
func Definition(def)
{
def["Name"] = "$Name$";
}
local Name = "$Name$";

View File

@ -2,19 +2,17 @@
protected func Initialize()
{
var iX, iY;
var iCount = LandscapeWidth()/65; //Determines how many clouds should be on a map
while(iCount!=0)
{
if(FindPosInMat(iX, iY, "Sky", 0,0,LandscapeWidth(), LandscapeHeight()) && MaterialDepthCheck(iX,iY,"Sky",200)==true) {
CreateObject(Cloud, iX, iY, NO_OWNER);
var pos;
if((pos = FindPosInMat("Sky", 0,0,LandscapeWidth(), LandscapeHeight())) && MaterialDepthCheck(pos[0],pos[1],"Sky",200)) {
CreateObject(Cloud, pos[0], pos[1], NO_OWNER);
iCount--;
}
}
AdjustLightningFrequency(GetScenarioVal("Lightning"));
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -129,7 +129,4 @@ protected func FxIntEarthquakeTimer(object target, int fxnum, int time)
/*-- Proplist --*/
protected func Definition(def)
{
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -47,6 +47,4 @@ public func SetPhase(int iphase)
//only appears during the night
public func IsCelestial() { return true; }
func Definition(def) {
SetProperty("Name","$Name$",def);
}
local Name = "$Name$";

View File

@ -29,7 +29,7 @@ global func SetTime(int iTime) //Sets the current time using a 1440-minute clock
AddEffect("IntSunrise",0,1,1);
}
timeobject->LocalN("itime")=iTime;
timeobject["itime"]=iTime;
if(timeobject!=nil) return 1;
else
return 0;
@ -94,12 +94,11 @@ protected func PlaceStars()
var maxamount=(LandscapeWidth()*LandscapeHeight())/40000;
var amount=0;
var iX;
var iY;
while(amount!=maxamount)
{
if(FindPosInMat(iX, iY, "Sky", 0,0,LandscapeWidth(), LandscapeHeight()))
CreateObject(Star,iX,iY); //Places stars around like PlacesObjects should, but that function is broken
var pos;
if(pos = FindPosInMat("Sky", 0,0,LandscapeWidth(), LandscapeHeight()))
CreateObject(Star,pos[0],pos[1]); //Places stars around like PlacesObjects should, but that function is broken
amount=++amount;
}
}
@ -185,6 +184,4 @@ global func FxRealTimeTimer(object target, int num, int time)
UpdateTime();
}
func Definition(def) {
SetProperty("Name","Time",def);
}
local Name = "Time";

View File

@ -14,6 +14,4 @@ protected func Initialize()
public func IsCelestial() { return true; }
func Definition(def) {
SetProperty("Name","$Name$",def);
}
local Name = "$Name$";

View File

@ -17,6 +17,4 @@ public func Incineration()
RemoveObject();
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -31,6 +31,4 @@ global func PlaceGrass(int iAmount, int start, int end)
}
}
func Definition(def) {
SetProperty("Name","Grass",def);
}
local Name = "Grass";

View File

@ -35,6 +35,4 @@ protected func ControlUse(object clonk, int iX, int iY)
RemoveObject();
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -10,6 +10,4 @@ private func Initialize()
SetProperty("MeshTransformation", Trans_Rotate(RandomX(0,359),0,1,0));
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -3,10 +3,6 @@ Marker for King of the Hill
Author: Zapper
*/
func Definition(def) {
def["Name"] = "$Name$";
}
func Initialize()
{
AddEffect("Timer", this, 10, 1, this);
@ -42,3 +38,5 @@ func FxTimerTimer()
this->SetClrModulation(origin->GetStarColor(Sin(this->GetActTime(), 50)));
}
local Name = "$Name$";

View File

@ -6,10 +6,6 @@
local origin;
local number;
func Definition(def) {
def["Name"] = "$Name$";
}
func Init(o, n)
{
this->SetObjectBlitMode(GFX_BLIT_Mod2);
@ -29,3 +25,5 @@ func FxTimerTimer()
{
this->SetClrModulation(origin->GetStarColor(number));
}
local Name = "$Name$";

View File

@ -12,10 +12,6 @@ local color;
local king;
local timer;
func Definition(def) {
def["Name"] = "$Name$";
}
func Initialize() {
ScheduleCall(this, "PostInitialize", 1, 0);
@ -152,3 +148,5 @@ func CreateStarCircle()
stars[GetLength(stars)]=star;
}
}
local Name = "$Name$";

View File

@ -64,8 +64,7 @@ public func SearchPosition()
func CalculatePosition()
{
var a=0, b=LandscapeHeight();
var x, y;
var lastX;
var lastY;
@ -73,19 +72,17 @@ func CalculatePosition()
{
var m=(a + b) / 2;
x=0;
y=m;
var free=PathFree2(x, y, LandscapeWidth(), m);
var block=PathFree2(0, m, LandscapeWidth(), m);
if(free)
if(!block)
{
a=m;
}
else
{
b=m;
lastX=x;
lastY=y;
lastX=block[0];
lastY=block[1];
}
}
@ -264,6 +261,4 @@ public func GetShortDescription(int plr)
return ""; // TODO
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -95,7 +95,4 @@ private func RelaunchClonk()
return;
}
protected func Definition(def)
{
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -98,12 +98,12 @@ protected func JoinPlayer(int plr)
var clonk = GetCrew(plr);
clonk->DoEnergy(100000);
var x, y;
FindRelaunchPos(plr, x, y);
clonk->SetPosition(x, y);
var pos = FindRelaunchPos(plr);
clonk->SetPosition(pos[0], pos[1]);
return;
}
private func FindRelaunchPos(int plr, int &x, int &y)
private func FindRelaunchPos(int plr)
{
var tx, ty; // Test position.
for (var i = 0; i < 500; i++)
@ -121,11 +121,9 @@ private func FindRelaunchPos(int plr, int &x, int &y)
if (GBackSemiSolid(AbsX(tx-5), AbsY(ty-10)))
continue;
// Succes.
x = tx;
y = ty;
break;
return [tx, ty];
}
return true;
return nil;
}
protected func RemovePlayer(int plr)
@ -159,7 +157,4 @@ private func LogKill(int killer, int victim)
return;
}
protected func Definition(def)
{
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -76,6 +76,4 @@ public func GetShortDescription(int plr)
return ""; // TODO
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -8,10 +8,7 @@ protected func Initialize()
/*-- Proplist --*/
protected func Definition(def)
{
SetProperty("Name", "$Name$", def);
SetProperty("ActMap", {
local ActMap = {
Show = {
Prototype = Action,
Name = "Show",
@ -24,5 +21,5 @@ protected func Definition(def)
Hgt = 20,
NextAction = "Show",
},
}, def);
}
};
local Name = "$Name$";

View File

@ -277,8 +277,4 @@ protected func GetColorByAngle(int angle)
}
/*-- Proplist --*/
protected func Definition(def)
{
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -301,18 +301,15 @@ protected func JoinPlayer(int plr)
{
var clonk = GetCrew(plr);
clonk->DoEnergy(100000);
var x, y;
FindRespawnPos(plr, x, y);
clonk->SetPosition(x, y);
var pos = FindRespawnPos(plr);
clonk->SetPosition(pos[0], pos[1]);
AddEffect("IntDirNextCP", clonk, 100, 1, this);
return;
}
private func FindRespawnPos(int plr, int &x, int &y)
private func FindRespawnPos(int plr)
{
x = respawn_list[plr]->GetX();
y = respawn_list[plr]->GetY();
return;
return [respawn_list[plr]->GetX(), respawn_list[plr]->GetY()];
}
protected func RemovePlayer(int plr)
@ -472,8 +469,4 @@ private func AddEvalData(int plr)
}
/*-- Proplist --*/
protected func Definition(def)
{
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -29,8 +29,4 @@ public func Fulfill()
/*-- Proplist --*/
func Definition(def)
{
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -230,8 +230,4 @@ func Close()
RemoveObject();
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -5,8 +5,6 @@ protected func Incineration()
Schedule("Explode(20)", 90);
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -12,8 +12,6 @@ protected func Hit()
Sound("RockHit*");
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -16,8 +16,6 @@ protected func Hit()
return 1;
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -12,8 +12,6 @@ func Hit()
Explode(20);
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -13,8 +13,6 @@ protected func Hit()
return 1;
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("Collectible", 1, def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -35,8 +35,6 @@ private func Freeze()
}
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -15,12 +15,6 @@ protected func Construction()
SetGraphics(Format("%d",graphic));
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
// Impact sound
func Hit()
{
@ -145,3 +139,7 @@ private func LoamDone(object clonk)
// Remove Effect
RemoveEffect("IntBridge", clonk);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -12,7 +12,5 @@ protected func Hit()
return 1;
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Name = "$Name$";
local Description = "$Description$";

View File

@ -12,8 +12,6 @@ protected func Hit()
Sound("RockHit*");
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -13,8 +13,6 @@ protected func Hit()
return 1;
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -24,8 +24,6 @@ private func Hit()
RemoveObject();
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -12,8 +12,6 @@ protected func Hit()
Sound("CrystalHit*");
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -14,8 +14,6 @@ func Incineration()
public func IsFuel() { return 1; }
public func GetFuelAmount() { return 30; }
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -24,8 +24,6 @@ public func IsTool() { return 1; }
public func IsToolProduct() { return 1; }
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -109,8 +109,7 @@ private func FxFloatTimer(object target, int num, int time)
}
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Float = {
Prototype = Action,
@ -145,6 +144,5 @@ Deflate = {
EndCall = "Pack",
Animation = "Deflate",
},
}, def);
SetProperty("Name", "$Name$",def);
}
};
local Name = "$Name$";

View File

@ -11,8 +11,8 @@ func ControlUseStart(object clonk, int ix, int iy)
//Lots of object pointers
user = clonk;
clonk->SetAction("Ride",balloon);
balloon->LocalN("rider") = clonk;
balloon->LocalN("parent") = this;
balloon["rider"] = clonk;
balloon["parent"] = this;
AddEffect("NoDrop",this,1,1,this);
return 1;
@ -26,8 +26,6 @@ func FxNoDropTimer(object target, int num, int timer)
}
}
func Definition(def) {
SetProperty("Name", "$Name$" ,def);
SetProperty("Description", "$Description$", def);
SetProperty("Collectible", 1, def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -108,8 +108,7 @@ protected func Collection(object obj, bool put)
public func IsToolProduct() { return 1; }
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -206,9 +206,8 @@ func GetFuel()
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("Collectible",1, def);
SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(30,0,0,1),Trans_Rotate(-30,1,0,0),Trans_Scale(1300)),def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -44,8 +44,7 @@ private func BreakMessage()
pLine->Message("$TxtLinebroke$");
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Connect = {
Prototype = Action,
Name = "Connect",
@ -53,7 +52,7 @@ func Definition(def) {
Delay = 0,
Procedure = DFA_CONNECT,
NextAction = "Connect",
}, }, def);
SetProperty("Name", "$Name$", def);
}
},
};
local Name = "$Name$";

View File

@ -65,7 +65,5 @@ private func Find_PowerLine(object pObject)
return [C4FO_Func, "IsConnectedTo", pObject];
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Name = "$Name$";
local Description = "$Description$";

View File

@ -53,14 +53,15 @@ public func ControlUse(object clonk, int x, int y, bool box)
private func Place(object clonk, int x, int y, bool box)
{
var angle = Angle(0,0,x,y);
if(GetWall(angle, x, y, clonk))
var pos = GetWall(angle);
if(pos)
{
if(box) SetReady();
// put into ...
Sound("Connect");
Exit(x, y, Angle(x,y));
SetPosition(clonk->GetX()+x, clonk->GetY()+y);
Exit(pos[0], pos[1], Angle(pos[0],pos[1]));
SetPosition(clonk->GetX()+pos[0], clonk->GetY()+pos[1]);
return true;
}
return false;
@ -77,18 +78,14 @@ public func Fuse()
// returns true if there is a wall in direction in which "clonk" looks
// and puts the offset to the wall into "xo, yo" - looking from the clonk
private func GetWall(angle, &x, &y)
private func GetWall(angle)
{
var dist = 12;
for(var dist = 12; dist < 18; dist++)
{
x = Sin(angle, dist);
y = -Cos(angle, dist);
if(GBackSolid(x, y))
{
x = Sin(angle, dist-5);
y = -Cos(angle, dist-5);
return true;
return [Sin(angle, dist-5), -Cos(angle, dist-5)];
}
}
return false;
@ -152,30 +149,27 @@ public func DoExplode()
Explode(18);
}
protected func Definition(def) {
def["Name"] = "Dynamite";
def["Description"] = "$Description$";
def["ActMap"] = {
Fuse = {
Prototype = Action,
Name = "Fuse",
Procedure = DFA_NONE,
NextAction = "Fuse",
Delay = 1,
Length = 1,
FacetBase = 1,
Sound = "Fusing",
StartCall = "Fusing"
},
Ready = {
Prototype = Action,
Name = "Ready",
Procedure = DFA_NONE,
NextAction = "Ready",
Delay = 1,
Length = 1,
FacetBase = 1,
}
};
}
local ActMap = {
Fuse = {
Prototype = Action,
Name = "Fuse",
Procedure = DFA_NONE,
NextAction = "Fuse",
Delay = 1,
Length = 1,
FacetBase = 1,
Sound = "Fusing",
StartCall = "Fusing"
},
Ready = {
Prototype = Action,
Name = "Ready",
Procedure = DFA_NONE,
NextAction = "Ready",
Delay = 1,
Length = 1,
FacetBase = 1,
}
};
local Name = "Dynamite";
local Description = "$Description$";

View File

@ -96,8 +96,7 @@ func FxIntFusingTimer()
public func IsFuse() { return true; }
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Connect = {
Prototype = Action,
Name = "Connect",
@ -113,7 +112,7 @@ func Definition(def) {
Delay = 0,
Procedure = DFA_NONE,//CONNECT,
NextAction = "Fusing",
}, }, def);
SetProperty("Name", "$Name$", def);
}
},
};
local Name = "$Name$";

View File

@ -74,8 +74,9 @@ public func ResetClonk(clonk)
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation",Trans_Scale(), def); // Hide it TODO: Remove if the mesh isn't shown if there is a picture set
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -157,8 +157,8 @@ func FxIntLengthStop(pTarget, iNumber, iReason, fTmp)
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation",Trans_Scale(), def); // Hide it TODO: Remove if the mesh isn't shown if there is a picture set
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -149,9 +149,7 @@ public func OnRopeBreak()
return;
}
protected func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";
/*-- Grapple rope controls --*/

View File

@ -207,13 +207,14 @@ func SetLineTransform(obj, int r, int xoff, int yoff, int length, int layer, int
);
}
protected func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("LineColors", [RGB(66,33,00) , RGB(66,33,00)], def);
SetProperty("ActMap", {
func Definition(def)
{
def.LineColors = [RGB(66,33,00), RGB(66,33,00)];
}
local ActMap = {
Hide = {
Prototype = Action,
Name = "Hide",
},
}, def);
}
};
local Name = "$Name$";

View File

@ -175,7 +175,7 @@ public func Reset(clonk)
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation",Trans_Mul(Trans_Translate(-700,400),Trans_Scale(1150),Trans_Rotate(180,0,1,0),Trans_Rotate(-30,-1,0,-1)),def);
}
}
local Name = "$Name$";
local Description = "$Description$";

View File

@ -77,8 +77,8 @@ public func IsTool() { return 1; }
public func IsToolProduct() { return 1; }
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation",Trans_Rotate(20,1,0,1),def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -139,7 +139,5 @@ private func FireWeapon(object pClonk,iX,iY)
}
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Name = "$Name$";
local Description = "$Description$";

View File

@ -94,7 +94,5 @@ protected func FxChargeTimer(object pTarget, int iEffectNumber, int iEffectTime)
}
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Name = "$Name$";
local Description = "$Description$";

View File

@ -26,9 +26,6 @@ public func GetCarryTransform()
//wants to make that, good luck! :) - Ringwaul
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation",Trans_Mul(Trans_Rotate(40, 0, 0, 1),Trans_Rotate(150, 0, 1, 0), Trans_Scale(900), Trans_Translate(600, 400, 1000)),def);
}
@ -208,3 +205,7 @@ public func Reset(clonk)
public func IsTool() { return 1; }
public func IsToolProduct() { return 1; }
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -122,8 +122,6 @@ public func OnProjectileHit()
func IsAlchemyProduct() { return 1; }
func AlchemyProcessTime() { return 100; }
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -19,15 +19,13 @@ func GetInteractionMetaInfo(object clonk)
return { Description = "$GrabLadder$", IconName = nil, IconID = nil, Selected = false };
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Attach = {
Prototype = Action,
Name = "Attach",
Procedure = DFA_ATTACH,
},},
def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
},
};
local Name = "$Name$";
local Description = "$Description$";

View File

@ -20,14 +20,13 @@ public func CanNotBeClimbed(bool fClimbing)
return false;
}
public func GetLadderData(&startx, &starty, &endx, &endy, &angle)
public func GetLadderData()
{
if(master != nil)
{
master->~GetLadderData(index, startx, starty, endx, endy, angle);
return;
return master->~GetLadderData(index);
}
return _inherited(startx, starty, endx, endy, angle);
return _inherited();
}
public func LogLadderData()

View File

@ -430,16 +430,14 @@ public func OnLadderClimb(clonk, index)
}
}
public func GetLadderData(index, &startx, &starty, &endx, &endy, &angle)
public func GetLadderData(index)
{
startx = particles[index][0][0]*10;
starty = particles[index][0][1]*10;
var startx = particles[index][0][0]*10;
var starty = particles[index][0][1]*10;
if(index == 0)
{
endx = startx;
endy = starty-5000;
angle = Angle(particles[2][0][0], particles[2][0][1], particles[0][0][0], particles[0][0][1]);
return true;
var angle = Angle(particles[2][0][0], particles[2][0][1], particles[0][0][0], particles[0][0][1]);
return [startx, starty, startx, starty-5000, angle];
}
if(index == ParticleCount-1 || segments[index+1]->CanNotBeClimbed())
{
@ -447,18 +445,16 @@ public func GetLadderData(index, &startx, &starty, &endx, &endy, &angle)
}
else
angle = Angle(particles[index+1][0][0], particles[index+1][0][1], particles[index-1][0][0], particles[index-1][0][1]);
endx = particles[index-1][0][0]*10;
endy = particles[index-1][0][1]*10;
return true;
var endx = particles[index-1][0][0]*10;
var endy = particles[index-1][0][1]*10;
return [startx, starty, endx, endy, angle];
}
func Definition(def) {
SetProperty("ActMap", {
Hanging = {
Prototype = Action,
Name = "Hanging"
},}, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local ActMap = {
Hanging = {
Prototype = Action,
Name = "Hanging"
},
};
local Name = "$Name$";
local Description = "$Description$";

View File

@ -145,8 +145,9 @@ public func IsTool() { return 1; }
public func IsToolProduct() { return 1; }
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(135, 0, 0, 1),Trans_Rotate(30, 0, 1, 0)),def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -149,7 +149,5 @@ func RejectEntrance()
return _inherited(...);
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
local Name = "$Name$";
local Description = "$Description$";

View File

@ -224,7 +224,8 @@ func Deselection()
}
*/
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation",Trans_Mul(Trans_Translate(-2000,-3000,-2000),Trans_Rotate(180,0,1,0),Trans_Rotate(-25,1,0,1)),def);
}
local Name = "$Name$";
local Description = "$Description$";

View File

@ -111,8 +111,9 @@ public func IsTool() { return 1; }
public func IsToolProduct() { return 1; }
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation",Trans_Rotate(-30,0,0,1),def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -205,8 +205,8 @@ protected func FxFlightTimer(object pTarget,int iEffectNumber, int iEffectTime)
var anglediff = Normalize(Angle(oldx,oldy,newx,newy)-GetR(),-180);
pTarget->SetRDir(anglediff/2);
pTarget->EffectVar(0,pTarget,iEffectNumber) = newx;
pTarget->EffectVar(1,pTarget,iEffectNumber) = newy;
EffectVar(0,pTarget,iEffectNumber) = newx;
EffectVar(1,pTarget,iEffectNumber) = newy;
pTarget->SetR(Angle(0,0,pTarget->GetXDir(),pTarget->GetYDir()));
}
@ -216,8 +216,9 @@ protected func FxFlightStop(object pTarget,int iEffectNumber)
}
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation", Trans_Mul(Trans_Rotate(40,0,0,1),Trans_Rotate(-10,1,0,0)),def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -108,8 +108,7 @@ public func TrailColor(int time)
return RGBa(255,255,255,240*Max(0,FlightTime()-time)/FlightTime());
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Travel = {
Prototype = Action,
@ -120,8 +119,8 @@ func Definition(def) {
Delay = 1,
FacetBase = 1,
StartCall = "Traveling"
}}, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
}
},
};
local Name = "$Name$";
local Description = "$Description$";

View File

@ -113,8 +113,7 @@ public func DrawTransform() {
);
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Travel = {
Prototype = Action,
@ -130,5 +129,5 @@ Travel = {
OffX = 0,
OffY = 2,
StartCall = "Traveling"
}}, def);
}
},
};

View File

@ -170,7 +170,8 @@ func RejectCollect(id shotid, object shot)
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation",Trans_Mul(Trans_Translate(1500,0,-1500),Trans_Rotate(170,0,1,0),Trans_Rotate(30,0,0,1)),def);
}
local Name = "$Name$";
local Description = "$Description$";

View File

@ -202,8 +202,9 @@ public func GetCarryTransform(clonk, sec, back)
local mTrans;
func Definition(def) {
SetProperty("Collectible", 1, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
SetProperty("PictureTransformation",Trans_Mul(Trans_Translate(1000,-500),Trans_Rotate(20,1,1,-1),Trans_Scale(1200)),def);
}
local Collectible = 1;
local Name = "$Name$";
local Description = "$Description$";

View File

@ -86,6 +86,4 @@ protected func RejectEntrance(object pContainer)
return 1;// !Library_Animal_IsCollectible(pContainer); TODO create this rule :-)
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -3,10 +3,6 @@
// Author: Randrian
// TODO -> torough explanation how to use it
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
func Initialize()
{
var iPlrNumber = GetOwner()%4+1;
@ -176,4 +172,6 @@ public func DoDoHomebaseProduction (id idID, int iChange)
iIndex++;
}
return false;
}
}
local Name = "$Name$";

View File

@ -6,10 +6,6 @@
local fIsBase;
local iEnergy;
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
// ---------------- Settings for base funcionallity --------------------
// --- these functions can be overloaded for vendors or special bases ---
@ -440,3 +436,5 @@ global func GetBase ()
if(!(this->~IsBase())) return NO_OWNER;
return GetOwner();
}
local Name = "$Name$";

View File

@ -61,6 +61,4 @@ func Collection2(obj)
return _inherited (obj);
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -18,7 +18,4 @@ func NotifyHUD() { if (ExtraHUD) ExtraHUD->Update(); }
func Collection2() { NotifyHUD(); return _inherited(...); }
func Ejection() { NotifyHUD(); return _inherited(...); }
func Definition(def)
{
SetProperty("Name", "ExtraSlot", def);
}
local Name = "ExtraSlot";

View File

@ -116,7 +116,4 @@ private func Exchange(object chest_content, object clonk_content, object clonk,
clonk_content->Enter(this);
}
protected func Definition(def)
{
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -12,21 +12,25 @@ func GetTurnPhase() { return _inherited(...); }
func Definition(def) {
// add action
SetProperty("Climb", {
Prototype = Action,
Name = "Climb",
Directions = 2,
Length = 0,
Delay = 0,
Wdt = 8,
Hgt = 20,
Procedure = DFA_FLOAT,
}, GetProperty("ActMap"));
// save old phasecall of jump
var jump_startcall = GetProperty("StartCall", GetProperty("Jump", GetProperty("ActMap")));
// and add new one
SetProperty("StartCall", "StartSearchLadder", GetProperty("Jump", GetProperty("ActMap")));
SetProperty("StartCallLadderOverloaded", jump_startcall, GetProperty("Jump", GetProperty("ActMap")));
def.ActMap = {
Prototype = def.ActMap,
Climb = {
Prototype = Action,
Name = "Climb",
Directions = 2,
Length = 0,
Delay = 0,
Wdt = 8,
Hgt = 20,
Procedure = DFA_FLOAT,
},
Jump = {
Prototype = def.ActMap.Jump,
StartCall = "StartSearchLadder",
// save old phasecall of jump
StartCallLadderOverloaded = def.ActMap.Jump.StartCall
}
};
_inherited(def);
}
@ -191,8 +195,8 @@ func FxIntClimbControlTimer(target, number)
}
return -1;
}
var startx, starty, endx, endy, angle;
EffectVar(0, target, number)->GetLadderData(startx, starty, endx, endy, angle);
var data = EffectVar(0, target, number)->GetLadderData();
var startx = data[0], starty = data[1], endx = data[2], endy = data[3], angle = data[4];
var x = startx + (endx-startx)*EffectVar(1, target, number)/100+5000-100*GetTurnPhase();
var y = starty + (endy-starty)*EffectVar(1, target, number)/100;
var old_x = GetX(), old_y = GetY();
@ -346,4 +350,4 @@ func SetLadderRotation (int r, int xoff, int yoff) {
+fcos, +fsin, xoff, //(1000-fcos)*xoff - fsin*yoff,
-fsin, +fcos, yoff, //(1000-fcos)*yoff + fsin*xoff,
);
}
}

View File

@ -11,14 +11,15 @@ local prev_segment;
public func IsLadder() { return true; }
// Returns the segment (start position, end position) on which the clonk can climb.
public func GetLadderData(&startx, &starty, &endx, &endy, &angle)
public func GetLadderData()
{
// Normally (if not overloaded) interpret the first vertex as start and the second as end
startx = GetX() + GetVertex(0, 0);
starty = GetY() + GetVertex(0, 1);
endx = GetX() + GetVertex(1, 0);
endy = GetY() + GetVertex(1, 1);
angle = 0;
return [
GetX() + GetVertex(0, 0),
GetY() + GetVertex(0, 1),
GetX() + GetVertex(1, 0),
GetY() + GetVertex(1, 1),
0];
}
// Get the connected segments

View File

@ -71,7 +71,4 @@ public func GetDeathCol()
return 101;
}
protected func Definition(def)
{
SetProperty("Name", "Scoreboard Deaths", def);
}
local Name = "Scoreboard Deaths";

View File

@ -83,8 +83,5 @@ public func GetKillCol()
//return ScoreboardCol(Scoreboard_Kill);
return 107;
}
protected func Definition(def)
{
SetProperty("Name", "Scoreboard Kills", def);
}
local Name = "Scoreboard Kills";

View File

@ -87,8 +87,5 @@ public func GetKillStreakCol()
//return ScoreboardCol(Scoreboard_KillStreak);
return 109;
}
protected func Definition(def)
{
SetProperty("Name", "Scoreboard Kill streaks", def);
}
local Name = "Scoreboard Kill streaks";

View File

@ -38,7 +38,4 @@ protected func RemovePlayer(int plr)
/*-- Misc --*/
protected func Definition(def)
{
SetProperty("Name", "Scoreboard Players", def);
}
local Name = "Scoreboard Players";

View File

@ -83,8 +83,5 @@ public func RelaunchCount()
{
return 5;
}
protected func Definition(def)
{
SetProperty("Name", "Scoreboard Relaunches", def);
}
local Name = "Scoreboard Relaunches";

View File

@ -6,6 +6,4 @@ protected func Activate(int iByPlayer)
return true;
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -11,6 +11,4 @@ func Activate(int plr)
clonk->RemoveObject();
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -52,6 +52,7 @@ private func Close()
protected func Definition(def)
{
SetProperty("Name", "$Name$", def);
SetProperty("PictureTransformation",Trans_Mul(Trans_Translate(0,-3000,-5000),Trans_Rotate(-30,1,0,0),Trans_Rotate(30,0,1,0),Trans_Translate(1000,1,0)),def);
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(0,-3000,-5000), Trans_Rotate(-30,1,0,0), Trans_Rotate(30,0,1,0), Trans_Translate(1000,1,0)),def);
}
local Name = "$Name$";

View File

@ -66,8 +66,7 @@ func ConsumeFuel()
}
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Work = {
Prototype = Action,
Name = "Work",
@ -83,6 +82,6 @@ Work = {
NextAction = "Work",
Animation = "Work",
EndCall = "ConsumeFuel",
}, }, def);
SetProperty("Name", "$Name$", def);
}
},
};
local Name = "$Name$";

View File

@ -200,8 +200,7 @@ private func FindIncompleteContents(idSearched)
return 0;
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Build = {
Prototype = Action,
Name = "Build",
@ -212,7 +211,10 @@ Build = {
NextAction = "Build",
//Animation = "Turn",
PhaseCall="Smoking",
}, }, def);
SetProperty("Name", "$Name$", def);
},
};
func Definition(def) {
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(2000,0,7000),Trans_Rotate(-20,1,0,0),Trans_Rotate(30,0,1,0)), def);
}
local Name = "$Name$";

View File

@ -53,6 +53,4 @@ func Wind2Turn()
}
}
func Definition(def) {
SetProperty("Name", "$Name$", def);
}
local Name = "$Name$";

View File

@ -12,8 +12,7 @@ protected func IsBuilt()
return GetCon() >= 100;
}
func Definition(def) {
SetProperty("ActMap", {/*
local ActMap = {/*
Idle = {
Prototype = Action,
Name = "Idle",
@ -54,8 +53,10 @@ CloseDoor = {
StartCall = "SoundCloseDoor",
Animation = "CloseDoor",
},
}, def);
SetProperty("Name", "$Name$", def);
};
func Definition(def) {
SetProperty("PictureTransformation", Trans_Mul(Trans_Translate(2000,0,7000),Trans_Rotate(-20,1,0,0),Trans_Rotate(30,0,1,0)), def);
SetProperty("MeshTransformation", Trans_Rotate(-8,0,1,0));
}
local Name = "$Name$";

View File

@ -315,8 +315,7 @@ func Timer()
olddir = GetDir();
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Roll = {
Prototype = Action,
Name = "Roll",
@ -330,8 +329,12 @@ Roll = {
Wdt = 22,
Hgt = 16,
NextAction = "Roll",
}, }, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
},
};
func Definitio(def)
{
SetProperty("PictureTransformation",Trans_Mul(Trans_Translate(6000,0,0),Trans_Rotate(-20,1,0,0),Trans_Rotate(35,0,1,0),Trans_Scale(1350)),def);
}
local Name = "$Name$";
local Description = "$Description$";

View File

@ -94,8 +94,7 @@ func TurnWheels()
}
}
func Definition(def) {
SetProperty("ActMap", {
local ActMap = {
Drive = {
Prototype = Action,
Name = "Drive",
@ -111,8 +110,12 @@ func Definition(def) {
NextAction = "Drive",
//Animation = "Drive",
},
}, def);
SetProperty("Name", "$Name$", def);
SetProperty("Description", "$Description$", def);
};
func Definition(def)
{
SetProperty("PictureTransformation",Trans_Mul(Trans_Rotate(-25,1,0,0),Trans_Rotate(40,0,1,0)),def);
}
local Name = "$Name$";
local Description = "$Description$";

View File

@ -5,36 +5,40 @@ protected func Initialize()
// Create the parkour goal.
var goal = CreateObject(Goal_Parkour, 0, 0, NO_OWNER);
// Set start point.
var x, y;
var x, y, pos;
var d = 100;
while(!FindPosInMat(x, y, "Sky", 0, LandscapeHeight() - d - 40, LandscapeWidth(), 40, 20) && d < LandscapeHeight())
while(!(pos = FindPosInMat("Sky", 0, LandscapeHeight() - d - 40, LandscapeWidth(), 40, 20)) && d < LandscapeHeight())
d += 10;
x = pos[0]; y = pos[1];
goal->SetStartpoint(x, y);
// Set some checkpoints.
while (d < LandscapeHeight() - 350)
{
var mode = PARKOUR_CP_Check;
d += RandomX(150, 250);
if (!FindPosInMat(x, y, "Tunnel", 0, LandscapeHeight() - d - 80, LandscapeWidth(), 80, 20) || !Random(3))
FindPosInMat(x, y, "Sky", 0, LandscapeHeight() - d - 80, LandscapeWidth(), 80, 20);
if (!(pos = FindPosInMat("Tunnel", 0, LandscapeHeight() - d - 80, LandscapeWidth(), 80, 20)) || !Random(3))
pos = FindPosInMat("Sky", 0, LandscapeHeight() - d - 80, LandscapeWidth(), 80, 20);
else
mode = mode | PARKOUR_CP_Respawn;
x = pos[0]; y = pos[1];
// All checkpoints ordered.
mode = mode | PARKOUR_CP_Ordered;
goal->AddCheckpoint(x, y, mode);
}
// Set finish point.
d = 0;
while(!FindPosInMat(x, y, "Sky", 0, 20 + d, LandscapeWidth(), 40, 20) && d < LandscapeHeight())
while(!(pos = FindPosInMat("Sky", 0, 20 + d, LandscapeWidth(), 40, 20)) && d < LandscapeHeight())
d += 10;
x = pos[0]; y = pos[1];
goal->SetFinishpoint(x, y);
// Place chests.
d = 300;
while (d < LandscapeHeight() - 300)
{
var i = 0;
while (!FindPosInMat(x, y, "Tunnel", 0, d, LandscapeWidth(), 300, 15) && i < 25)
while (!(pos = FindPosInMat("Tunnel", 0, d, LandscapeWidth(), 300, 15)) && i < 25)
i++; // Max 25 attempts.
x = pos[0]; y = pos[1];
CreateObject(Chest, x, y + 8, NO_OWNER);
d += RandomX(250, 300);
}
@ -50,24 +54,22 @@ protected func Initialize()
return;
}
protected func FindPosInMat(int &tx, int &ty, string mat, int rx, int ry, int wdt, int hgt, int size)
protected func FindPosInMat(string mat, int rx, int ry, int wdt, int hgt, int size)
{
var x, y;
for (var i = 0; i < 500; i++)
{
x = rx + Random(wdt);
y = ry + Random(hgt);
var x = rx + Random(wdt);
var y = ry + Random(hgt);
if(GetMaterial(AbsX(x), AbsY(y)) == Material(mat) &&
GetMaterial(AbsX(x+size), AbsY(y+size)) == Material(mat) &&
GetMaterial(AbsX(x+size), AbsY(y-size)) == Material(mat) &&
GetMaterial(AbsX(x-size), AbsY(y-size)) == Material(mat) &&
GetMaterial(AbsX(x-size), AbsY(y+size)) == Material(mat))
{
tx = x; ty = y;
return true; // Location found.
return [x, y];
}
}
return false; // No location found.
return 0;
}
// Gamecall from parkour goal, on respawning.
@ -104,4 +106,4 @@ global func FxIntSnowTimer(object target, int fxnum)
return FX_OK;
CastPXS("Snow", RandomX(8, 16), 10, EffectVar(0, nil, fxnum), 1, RandomX(160, 200));
return FX_OK;
}
}

View File

@ -26,7 +26,12 @@ static const DFA_ATTACH = 14;
static const DFA_FIGHT = 15;
static const DFA_CONNECT = 16;
static const DFA_PULL = 17;
static Action;
static const Action = {
Length = 1,
Directions = 1,
Step = 1,
Procedure = DFA_NONE,
};
global func GetActMapVal(string entry, string action, id def, int num)
{

View File

@ -27,12 +27,8 @@ global func SetRGBaValue(int val, int newval, int sel)
return val | newval << ((3 - sel) * 8);
}
global func SplitRGBaValue(int rgb, int &red, int &green, int &blue, int &alpha) {
red = GetRGBaValue(rgb, 1);
green = GetRGBaValue(rgb, 2);
blue = GetRGBaValue(rgb, 3);
alpha = GetRGBaValue(rgb, 0);
return;
global func SplitRGBaValue(int rgb) {
return [GetRGBaValue(rgb, 1), GetRGBaValue(rgb, 2), GetRGBaValue(rgb, 3), GetRGBaValue(rgb, 0)];
}
global func HSL2RGB(int hsl)

Some files were not shown because too many files have changed in this diff Show More