diff options
Diffstat (limited to 'TemplePushing.c4s/Locals.c4d/Cannon.c4d')
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/ActMap.txt | 8 | ||||
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/DefCore.txt | 24 | ||||
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/DescDE.txt | 1 | ||||
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/DescUS.txt | 1 | ||||
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/Graphics.png | bin | 0 -> 26534 bytes | |||
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/Names.txt | 2 | ||||
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/Script.c | 176 | ||||
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/StringTblDE.txt | 4 | ||||
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/StringTblUS.txt | 4 | ||||
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/Symbols.c4d/DefCore.txt | 8 | ||||
| -rw-r--r-- | TemplePushing.c4s/Locals.c4d/Cannon.c4d/Symbols.c4d/Graphics.png | bin | 0 -> 20663 bytes |
11 files changed, 228 insertions, 0 deletions
diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/ActMap.txt b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/ActMap.txt new file mode 100644 index 0000000..52447a1 --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/ActMap.txt @@ -0,0 +1,8 @@ +[Action] +Name=Ready +Directions=2 +FlipDir=1 +Length=19 +Delay=0 +Facet=0,0,32,28 +NextAction=Hold diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/DefCore.txt b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/DefCore.txt new file mode 100644 index 0000000..c6c3b15 --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/DefCore.txt @@ -0,0 +1,24 @@ +[DefCore] +id=CANN +Version=4,9,8 +Name=Cannon +Category=C4D_Vehicle|C4D_SelectVehicle|C4D_SelectKnowledge|C4D_SelectHomebase +MaxUserSelect=2 +Width=32 +Height=28 +Offset=-16,-14 +Vertices=3 +VertexX=1,-8,7 +VertexY=1,13,13 +VertexCNAT=4,9,10 +VertexFriction=100,10,10 +Value=35 +Mass=110 +Components=METL=3 +Picture=608,0,64,64 +CollectionLimit=10 +Rebuy=1 +Grab=1 +GrabPutGet=C4D_GrabGet|C4D_GrabPut +UprightAttach=8 +VehicleControl=1 diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/DescDE.txt b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/DescDE.txt new file mode 100644 index 0000000..76bb149 --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/DescDE.txt @@ -0,0 +1 @@ +Mächtige Langstreckenwaffe. Benötigt für einen Schuss eine Ladung Schießpulver.
\ No newline at end of file diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/DescUS.txt b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/DescUS.txt new file mode 100644 index 0000000..993a638 --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/DescUS.txt @@ -0,0 +1 @@ +Heavy artillery. Requires one load of gunpowder per shot.
\ No newline at end of file diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Graphics.png b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Graphics.png Binary files differnew file mode 100644 index 0000000..abe856a --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Graphics.png diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Names.txt b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Names.txt new file mode 100644 index 0000000..2a69811 --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Names.txt @@ -0,0 +1,2 @@ +DE:Haubitze +US:Cannon diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Script.c b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Script.c new file mode 100644 index 0000000..c77c034 --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Script.c @@ -0,0 +1,176 @@ +/*-- Haubitze --*/ + +#strict +local WpID; + +/* Initialisierung */ + +protected func Initialize() +{ + WpID = [FLNT,EFLN,SFLN,TFLN]; + AddEffect("CreateCon",this(),100,150,this()); + SetAction("Ready"); + SetPhase(10); +} + +/* Steuerung */ + +protected func ControlConf(int conf) +{ + if(AimStdConf(conf)) + Sound("CatapultSet"); +} + +public func ControlUp(object clonk) // Zielen: hoch (klassisch) +{ + [$TxtAimup$|Image=CAN1:2] + AimUp(clonk, 4, "ControlConf"); +} + +public func ControlDig(object clonk) // Zielen: runter (klassisch) +{ + [$TxtAimdown$|Method=Classic|Image=CAN1:0] + AimDown(clonk, 4, "ControlConf"); +} + +public func ControlDown() +{ + [$TxtAimdown$|Method=JumpAndRun|Image=CAN1:0] // Beschreibung fuer JnR +} + +public func ControlUpdate(object clonk, int comdir) // Zielen: JnR +{ + AimUpdate(clonk, comdir, 4, "ControlConf"); +} + +public func ControlDownSingle() // Sicht zurücksetzen +{ + [$TxtResetview$|Method=None] +} + +public func ControlThrow(pClonk) // Feuern / Inhalt +{ + [$TxtFire$|Image=CAN1:1] + // Der Clonk will doch bestimmt nur etwas nachladen: nicht vorzeitig abfeuern + var pThing; + if (pThing = pClonk->Contents()) + if (AllowLoad(GetID(pThing))) + return(0); + // Abfeuern wenn möglich, sonst Objekt herausnehmen + return(Fire()); +} + +public func ControlCommand(string szCommand,object pTarget,int iX,int iY) +{ + // Feuern + if(szCommand eq "MoveTo") + if(Distance(GetX(),GetY(),iX,iY)>50) + { + HaltPushers(); + return(FireAt(iX,iY)); + } +} + +/* Prozesse */ + +private func HaltPushers() +{ + var pClonk; + // Alle Clonks die die Haubitze anfassen, sollen stoppen + while(pClonk=FindObject(0,0,0,0,0,0,"Push",this(),0,pClonk)) + SetComDir(COMD_Stop(),pClonk); +} + +public func Fire(bool fAuto) +{ + var pProjectile=FindOtherContents(GUNP); + // Ich brauch kein Schießpulver! + // Projektil fehlt + if (!pProjectile) + { + Sound("Click"); + return(0); + } + + // Austritt berechnen + var iX = (GetPhase()+3)*(GetDir()*2-1); + var iY = GetPhase()-14; + var iAngle = BoundBy(GetPhase()*5-5,0,90); + var iXDir = Sin(iAngle,32*(GetDir()*2-1)); + var iYDir = Cos(iAngle,-18); + + // Projektil abfeuern + Exit(pProjectile,iX,iY,Random(360),iXDir,iYDir,+30); + + // Sicht verfolgen (wenn kein automatischer Schuss) + if(!fAuto) + if(GetPlrViewMode(GetController())!=2) + SetPlrView(GetController(),pProjectile); + // Sound + Sound("Blast2"); + // Rauch + for (var i = 0; i < 6; ++i) + Smoke(iX+RandomX(-5,+5),iY+RandomX(-5,+5),RandomX(5,12)); + // Erfolgreich geschossen + return(1); +} + +/* Zielfunktionen */ + +public func FireAt(int iX,int iY,int fAuto) +{ + var iAngle; + // Zielwinkel + iAngle = Angle(GetX(),GetY(),iX,iY); + // Bei größerer Distanz höher zielen + if(Inside(iX-GetX(),+1,+300)) + iAngle -= Abs(iX-GetX())/12; + if(Inside(iX-GetX(),-300,-1)) + iAngle += Abs(iX-GetX())/12; + // Zielen + AimToAngle(iAngle); + // Feuern + return(Fire(fAuto)); +} + +public func AimToAngle(int iAngle) +{ + // Winkel anpassen + while(iAngle > 180) iAngle-=360; + // Richtung + if(iAngle > 0) SetDir(DIR_Right()); + if(iAngle < 0) SetDir(DIR_Left()); + // Zielrichtung + SetPhase(BoundBy( 19*Abs(iAngle)/90, 0,18)); +} + +/* Laden */ + +protected func Collection() { Sound("Connect"); } + +protected func RejectCollect(id idObj, object pObj) +{ + return(!AllowLoad(idObj)); +} + +private func AllowLoad(id idObj) +{ + // Noch jede Menge Platz + if (ContentsCount() < 9) return(1); + // Niemals mehr als 10 Objekte laden: Wird gebraucht, wenn aus ControlThrow aufgerufen! + if (ContentsCount() >= 10) return(0); + // Nicht mehr als 9 Projektile laden, wenn noch Platz für Pulver gebraucht wird + // Laden o.k. + return(1); +} + +/* Forschung */ + +public func GetResearchBase() { return(CATA); } + +func FxCreateConTimer() +{ + if (ContentsCount() < 10) + CreateContents(WpID[Random(5)]); + return(1); + } diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/StringTblDE.txt b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/StringTblDE.txt new file mode 100644 index 0000000..43693bc --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/StringTblDE.txt @@ -0,0 +1,4 @@ +TxtAimup=Zielen: auf +TxtAimdown=Zielen: ab +TxtFire=Feuern +TxtResetview=Sicht zurücksetzen diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/StringTblUS.txt b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/StringTblUS.txt new file mode 100644 index 0000000..b55ce20 --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/StringTblUS.txt @@ -0,0 +1,4 @@ +TxtAimup=Aim: up +TxtAimdown=Aim: down +TxtFire=Fire +TxtResetview=Reset view diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Symbols.c4d/DefCore.txt b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Symbols.c4d/DefCore.txt new file mode 100644 index 0000000..6fbcc4b --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Symbols.c4d/DefCore.txt @@ -0,0 +1,8 @@ +[DefCore] +id=CAN1 +Version=4,9,8 +Name=Symbol +Category=C4D_StaticBack +Width=1 +Height=1 +Picture=0,0,64,64 diff --git a/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Symbols.c4d/Graphics.png b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Symbols.c4d/Graphics.png Binary files differnew file mode 100644 index 0000000..25b3618 --- /dev/null +++ b/TemplePushing.c4s/Locals.c4d/Cannon.c4d/Symbols.c4d/Graphics.png |
