Visceroid spawning. Add tib death anims for e1 and e2. Others will crash.
This commit is contained in:
@@ -69,6 +69,7 @@
|
|||||||
<Compile Include="TiberiumRefinery.cs" />
|
<Compile Include="TiberiumRefinery.cs" />
|
||||||
<Compile Include="CncWaterPaletteRotation.cs" />
|
<Compile Include="CncWaterPaletteRotation.cs" />
|
||||||
<Compile Include="AttackPopupTurreted.cs" />
|
<Compile Include="AttackPopupTurreted.cs" />
|
||||||
|
<Compile Include="SpawnViceroid.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||||
|
|||||||
55
OpenRA.Mods.Cnc/SpawnViceroid.cs
Normal file
55
OpenRA.Mods.Cnc/SpawnViceroid.cs
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||||
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
|
* available to you under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation. For more information,
|
||||||
|
* see LICENSE.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using OpenRA.Traits;
|
||||||
|
using OpenRA.FileFormats;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.Cnc
|
||||||
|
{
|
||||||
|
class SpawnViceroidInfo : ITraitInfo
|
||||||
|
{
|
||||||
|
[ActorReference]
|
||||||
|
public readonly string ViceroidActor = "vice";
|
||||||
|
public readonly int Probability = 10;
|
||||||
|
public readonly string Owner = "Creeps";
|
||||||
|
public readonly int InfDeath = 5;
|
||||||
|
|
||||||
|
public object Create(ActorInitializer init) { return new SpawnViceroid(this); }
|
||||||
|
}
|
||||||
|
|
||||||
|
class SpawnViceroid : INotifyDamage
|
||||||
|
{
|
||||||
|
readonly SpawnViceroidInfo Info;
|
||||||
|
|
||||||
|
public SpawnViceroid(SpawnViceroidInfo info)
|
||||||
|
{
|
||||||
|
Info = info;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Damaged(Actor self, AttackInfo e)
|
||||||
|
{
|
||||||
|
if (e.DamageState == DamageState.Dead && e.Warhead.InfDeath == Info.InfDeath
|
||||||
|
&& self.World.SharedRandom.Next(100) <= Info.Probability)
|
||||||
|
self.World.AddFrameEndTask(w =>
|
||||||
|
{
|
||||||
|
var td = new TypeDictionary
|
||||||
|
{
|
||||||
|
new LocationInit( self.Location ),
|
||||||
|
new OwnerInit( self.World.players.Values.First(p => p.InternalName == Info.Owner) )
|
||||||
|
};
|
||||||
|
|
||||||
|
if (self.HasTrait<IFacing>())
|
||||||
|
td.Add(new FacingInit( self.Trait<IFacing>().Facing ));
|
||||||
|
w.CreateActor(Info.ViceroidActor, td);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -126,6 +126,7 @@
|
|||||||
Notification: unitlost.aud
|
Notification: unitlost.aud
|
||||||
ProximityCaptor:
|
ProximityCaptor:
|
||||||
Types:Infantry
|
Types:Infantry
|
||||||
|
SpawnViceroid:
|
||||||
|
|
||||||
^CivInfantry:
|
^CivInfantry:
|
||||||
Inherits: ^Infantry
|
Inherits: ^Infantry
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ E1:
|
|||||||
PrimaryWeapon: M16
|
PrimaryWeapon: M16
|
||||||
TakeCover:
|
TakeCover:
|
||||||
IdleAnimation:
|
IdleAnimation:
|
||||||
Animations: idle1,idle2,idle3
|
Animations: idle1,idle2,idle3,idle4
|
||||||
E2:
|
E2:
|
||||||
Inherits: ^Infantry
|
Inherits: ^Infantry
|
||||||
Valued:
|
Valued:
|
||||||
@@ -206,3 +206,4 @@ VICE:
|
|||||||
WithMuzzleFlash:
|
WithMuzzleFlash:
|
||||||
Armor:
|
Armor:
|
||||||
Type: Wood
|
Type: Wood
|
||||||
|
-PoisonedByTiberium:
|
||||||
@@ -45,22 +45,35 @@ e1:
|
|||||||
Start: 289
|
Start: 289
|
||||||
Length: 22
|
Length: 22
|
||||||
Tick: 120
|
Tick: 120
|
||||||
|
# Dancing
|
||||||
|
idle4:
|
||||||
|
Start: 517
|
||||||
|
Length: 9
|
||||||
|
Tick: 120
|
||||||
|
# Shot
|
||||||
die1:
|
die1:
|
||||||
Start: 381
|
Start: 381
|
||||||
Length: 9
|
Length: 9
|
||||||
die5:
|
# Explode
|
||||||
Start: 418
|
|
||||||
Length: 18
|
|
||||||
die4:
|
|
||||||
Start: 406
|
|
||||||
Length: 12
|
|
||||||
die3:
|
|
||||||
Start: 398
|
|
||||||
Length: 8
|
|
||||||
die2:
|
die2:
|
||||||
Start: 390
|
Start: 390
|
||||||
Length: 8
|
Length: 8
|
||||||
|
# Fly through air and explode
|
||||||
|
die3:
|
||||||
|
Start: 398
|
||||||
|
Length: 8
|
||||||
|
# Fly higher through air and explode
|
||||||
|
die4:
|
||||||
|
Start: 406
|
||||||
|
Length: 12
|
||||||
|
# Burn
|
||||||
|
die5:
|
||||||
|
Start: 418
|
||||||
|
Length: 18
|
||||||
|
# Tib
|
||||||
|
die6:
|
||||||
|
Start: 366
|
||||||
|
Length: 11
|
||||||
e2:
|
e2:
|
||||||
stand:
|
stand:
|
||||||
Start: 0
|
Start: 0
|
||||||
@@ -92,22 +105,30 @@ e2:
|
|||||||
Start: 400
|
Start: 400
|
||||||
Length: 13
|
Length: 13
|
||||||
Tick: 120
|
Tick: 120
|
||||||
die5:
|
# Shot
|
||||||
Start: 546
|
|
||||||
Length: 18
|
|
||||||
die4:
|
|
||||||
Start: 534
|
|
||||||
Length: 12
|
|
||||||
die3:
|
|
||||||
Start: 526
|
|
||||||
Length: 8
|
|
||||||
die2:
|
|
||||||
Start: 518
|
|
||||||
Length: 8
|
|
||||||
die1:
|
die1:
|
||||||
Start: 509
|
Start: 509
|
||||||
Length: 9
|
Length: 9
|
||||||
|
# Explode
|
||||||
|
die2:
|
||||||
|
Start: 518
|
||||||
|
Length: 8
|
||||||
|
# Fly through air
|
||||||
|
die3:
|
||||||
|
Start: 526
|
||||||
|
Length: 8
|
||||||
|
# Fly higher through air
|
||||||
|
die4:
|
||||||
|
Start: 534
|
||||||
|
Length: 12
|
||||||
|
# Burn
|
||||||
|
die5:
|
||||||
|
Start: 546
|
||||||
|
Length: 18
|
||||||
|
# Tib
|
||||||
|
die6:
|
||||||
|
Start: 494
|
||||||
|
Length: 11
|
||||||
e3:
|
e3:
|
||||||
stand:
|
stand:
|
||||||
Start: 0
|
Start: 0
|
||||||
|
|||||||
@@ -286,7 +286,7 @@ Chemspray:
|
|||||||
Wood: 75%
|
Wood: 75%
|
||||||
Light: 60%
|
Light: 60%
|
||||||
Heavy: 25%
|
Heavy: 25%
|
||||||
InfDeath: 2
|
InfDeath: 5
|
||||||
SmudgeType: Scorch
|
SmudgeType: Scorch
|
||||||
ImpactSound: xplos
|
ImpactSound: xplos
|
||||||
|
|
||||||
@@ -676,6 +676,6 @@ Tiberium:
|
|||||||
ROF: 10
|
ROF: 10
|
||||||
Warhead:
|
Warhead:
|
||||||
Spread: 1
|
Spread: 1
|
||||||
InfDeath: 4
|
InfDeath: 5
|
||||||
Damage: 5
|
Damage: 5
|
||||||
PreventProne: yes
|
PreventProne: yes
|
||||||
Reference in New Issue
Block a user