Visceroid spawning. Add tib death anims for e1 and e2. Others will crash.

This commit is contained in:
Paul Chote
2011-02-11 23:05:01 +13:00
parent 51138fcdc3
commit 03f014ffb9
6 changed files with 106 additions and 27 deletions

View File

@@ -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">

View 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);
});
}
}
}

View File

@@ -126,6 +126,7 @@
Notification: unitlost.aud Notification: unitlost.aud
ProximityCaptor: ProximityCaptor:
Types:Infantry Types:Infantry
SpawnViceroid:
^CivInfantry: ^CivInfantry:
Inherits: ^Infantry Inherits: ^Infantry

View File

@@ -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:
@@ -205,4 +205,5 @@ VICE:
RenderUnit: RenderUnit:
WithMuzzleFlash: WithMuzzleFlash:
Armor: Armor:
Type: Wood Type: Wood
-PoisonedByTiberium:

View File

@@ -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

View File

@@ -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