Added Monster as a test object

stable-5.2
Armin Burgmeier 2009-07-11 01:11:29 +02:00
parent 01f2da1366
commit 41f5a3d069
11 changed files with 11708 additions and 0 deletions

View File

@ -0,0 +1,81 @@
[Action]
Name=Walk
Procedure=WALK
Directions=2
FlipDir=1
Length=16
Delay=5
Facet=0,0,48,34
NextAction=Walk
TurnAction=Turn
StartCall=HitCheck
InLiquidAction=Swim
[Action]
Name=Turn
Procedure=NONE
Directions=2
FlipDir=1
Length=7
Delay=2
Facet=0,68,48,34
NextAction=Walk
[Action]
Name=Jump
Procedure=FLIGHT
Directions=2
FlipDir=1
Length=17
Delay=1
Facet=0,34,48,34
NextAction=Hold
InLiquidAction=Swim
[Action]
Name=Swim
Procedure=SWIM
Directions=2
FlipDir=1
Length=16
Delay=5
Facet=0,0,48,34
NextAction=Swim
TurnAction=Turn
StartCall=HitCheck
[Action]
Name=LookUp
Procedure=NONE
Attach=8
Directions=2
FlipDir=1
Length=12
Delay=1
Facet=0,102,48,34
NextAction=Look
InLiquidAction=Swim
[Action]
Name=Look
Attach=8
Procedure=NONE
Directions=2
FlipDir=1
Delay=15
Facet=528,102,48,34
NextAction=LookAway
InLiquidAction=Swim
[Action]
Name=LookAway
Attach=8
Procedure=NONE
Directions=2
FlipDir=1
Length=12
Delay=1
Reverse=1
Facet=0,102,48,34
NextAction=Walk
InLiquidAction=Swim

View File

@ -0,0 +1,44 @@
[DefCore]
id=MONS
Version=4,9,8
Name=Monster
Category=C4D_Living|C4D_SelectAnimal
MaxUserSelect=5
TimerCall=Activity
ContactCalls=1
Width=48
Height=34
Offset=-24,-17
Vertices=7
VertexX=-1,1,0,-6,-2,7,2
VertexY=-7,-7,12,-3,6,-3,6
VertexCNAT=5,6,8,1,1,2,2
VertexFriction=100,100,100,100,100,100
Value=35
Mass=100
Components=MONS=1
Picture=576,68,64,64
Growth=15
Float=1
BorderBound=1
StretchGrowth=1
NoBurnDecay=1
IncompleteActivity=1
VehicleControl=2
Pathfinder=1
ClosedContainer=2
NoFight=1
[Physical]
Energy=250000
Breath=50000
Walk=71000
Jump=50000
Scale=30000
Hangle=30000
Dig=40000
Swim=60000
Throw=50000
Push=40000
Fight=50000
CorrosionResist=1

View File

@ -0,0 +1 @@
Friedliebende grüne Zeitgenossen.

View File

@ -0,0 +1 @@
They want no harm.

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
DE:Monster
US:Monster

View File

@ -0,0 +1,14 @@
material Material.002
{
receive_shadows on
technique
{
pass
{
ambient 0.500000 0.500000 0.500000 1.000000
diffuse 0.000000 0.800000 0.169670 1.000000
specular 0.342542 0.500000 0.000000 1.000000 12.500000
emissive 0.000000 0.000000 0.000000 1.000000
}
}
}

View File

@ -0,0 +1,210 @@
/*-- Monster --*/
#strict 2
//#include ANIM
public func IsPossessible() { return 1; }
/* Initialisierung */
protected func Initialize() { SetAction("Walk"); }
/* TimerCall mit KI-Steuerung */
private func Activity()
{
// Die KI-Steuerung wird bei Besessenheit nicht gebraucht
if (GetEffect("PossessionSpell", this)) return;
// Nichts machen
if (Random(2) || (GetAction() != "Walk" && GetAction() != "Swim")) return 1;
// Springen
if (GetAction() == "Walk")
if (!Random(3)) return DoJump();
// Umsehen
if (GetAction() == "Walk")
if (!Random(8)) return SetAction("LookUp");
// Umdrehen
if (Random(2)) return TurnRight();
return TurnLeft();
}
/* Kontakte */
protected func ContactLeft()
{
// Die KI-Steuerung wird bei Besessenheit nicht gebraucht
if (GetEffect("PossessionSpell", this)) return;
return TurnRight();
}
protected func ContactRight()
{
// Die KI-Steuerung wird bei Besessenheit nicht gebraucht
if (GetEffect("PossessionSpell", this)) return;
return TurnLeft();
}
/* Aktionen */
public func TurnRight()
{
if (Stuck() || (GetAction() != "Walk" && GetAction() != "Swim")) return;
if (GetXDir() < 0) SetXDir(0);
SetDir(DIR_Right);
SetComDir(COMD_Right);
return 1;
}
public func TurnLeft()
{
if (Stuck() || (GetAction() != "Walk" && GetAction() != "Swim")) return;
if (GetXDir() > 0) SetXDir(0);
SetDir(DIR_Left);
SetComDir(COMD_Left);
return 1;
}
private func HitCheck()
{
var obj;
if (obj = FindObject(0, +1,0,0,0, OCF_Prey, 0,0, NoContainer()))
Punch(obj, 10);
return 1;
}
public func DoJump()
{
if (GetAction() != "Walk") return;
if (Random(2)) Sound("Growl*");
Jump();
}
/* Einwirkungen */
protected func Death()
{
Sound("DeathGrowl");
SetDir(DIR_Left);
ChangeDef(DMNS);
SetAction("Dead");
return 1;
}
/* Vermehrung */
private func ReproductionRate() { return 2000; } // Die Chance, dass in einem Timerintervall eine Vermehrung stattfindet
private func MaxAnimalCount() { return 4; } // Maximale Tieranzahl im Umkreis
/* Steuerung durch Besessenheit */
protected func ControlCommand(szCommand, pTarget, iTx, iTy)
{
// Bewegungskommando
if (szCommand == "MoveTo")
return SetCommand(this,szCommand, pTarget, iTx, iTy);
return 0;
}
protected func ContainedLeft(object caller)
{
[$TxtMovement$]
SetCommand(this, "None");
if(!GetPlrCoreJumpAndRunControl(caller->GetController()))
TurnLeft();
return 1;
}
protected func ContainedRight(object caller)
{
[$TxtMovement$]
SetCommand(this, "None");
if(!GetPlrCoreJumpAndRunControl(caller->GetController()))
TurnRight();
return 1;
}
protected func ContainedUp(object caller)
{
[$TxtMovement$]
SetCommand(this, "None");
if(Contained()) return SetCommand(this, "Exit");
if (GetAction() == "Swim")
{
if(!GetPlrCoreJumpAndRunControl(caller->GetController()))
SetComDir(COMD_Up);
return 1;
}
DoJump();
return 1;
}
protected func ContainedDown(object caller)
{
[$TxtMovement$]
SetCommand(this, "None");
if (GetAction() == "Swim")
{
if(!GetPlrCoreJumpAndRunControl(caller->GetController()))
SetComDir(COMD_Down);
return 1;
}
if (GetAction() == "Walk")
SetAction("LookUp");
return 1;
}
/* JumpAndRun Steuerung */
private func ClearDir(bool fX)
{
if(fX && GetXDir())
{
if(GetXDir() > 0) SetXDir(Max(GetXDir() - 2, 0));
else SetXDir(Min(GetXDir() + 2, 0));
}
if(!fX && GetYDir())
{
if(GetYDir() > 0) SetYDir(Max(GetYDir() - 2, 0));
else SetYDir(Min(GetYDir() + 2, 0));
}
}
public func ContainedUpdate(object self, int comdir)
{
if(GetAction() == "Swim")
{
SetComDir(comdir);
ClearScheduleCall(this, "ClearDir");
if(comdir == COMD_Down || comdir == COMD_Up) ScheduleCall(this, "ClearDir", 1, (Abs(GetXDir())+1)/2, true);
if(comdir == COMD_Left || comdir == COMD_Right) ScheduleCall(this, "ClearDir", 1, (Abs(GetYDir())+1)/2, false);
}
else
{
if(comdir == COMD_UpRight || comdir == COMD_DownRight) comdir = COMD_Right;
if(comdir == COMD_Up || comdir == COMD_Down) comdir = COMD_Stop;
if(comdir == COMD_UpLeft || comdir == COMD_DownLeft) comdir = COMD_Left;
SetComDir(comdir);
}
return 1;
}
protected func ContainedThrow() { return 1; }
protected func ContainedDigDouble()
{
[$TxtLeave$]
RemoveEffect("PossessionSpell", this);
return 1;
}

View File

@ -0,0 +1,2 @@
TxtMovement=Bewegen
TxtLeave=Zurückverwandeln

View File

@ -0,0 +1,2 @@
TxtMovement=Move
TxtLeave=Retransform