Skip to content

Commit

Permalink
merge
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickwieth committed Jun 4, 2024
2 parents 1cb7af9 + 9d4dd63 commit 7e795d8
Show file tree
Hide file tree
Showing 33 changed files with 889 additions and 567 deletions.
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Contributors & special thanks to:
* Orac (Chronoharv)
* Overwatch (Heavy Flame Tank, XO/Bastion, Support Battlefortress)
* Midian-P (Battlemaster, Outpost, Dragon Tank, Bulldozer, Supply Truck, Overlord, Helix, Chinese Mig, Centurion/Gene Splicer, ysgen/MSG, Bastion, Chinook)
* B.A.Znd (China Nuke Cannon, ISU, Katyusha, BPNE/Rice Cooker)
* B.A.Znd (China Nuke Cannon, ISU, Katyusha, BPNE/Rice Cooker, Soviet Miner)
* G-E (2S3 Akatsiya)
* partyzanPaulZy (MARV)
* L()KI (Ogunship/Orca.Drone)
Expand All @@ -85,6 +85,7 @@ Contributors & special thanks to:
* Medalmonkey/DerekPlus (Obelisktrooper, Mirage Trooper/Saboteur, Mercenary, Stormtrooper, Shock Trooper, Railgunner/Parasite)
* m7 (Microwave Tank)
* Merophage/RAPD (conscript)
* unknown_men (Crazy Ivan)

Of course YMCA wouldn't exist today without OpenRA & the
hard work of the many OpenRA contributors.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#region Copyright & License Information
/*
* Copyright 2007-2020 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, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion

using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;

namespace OpenRA.Mods.CA.Traits
{
public class GrantConditionOnDockingHarvesterInfo : TraitInfo, Requires<HarvesterInfo>
{
[FieldLoader.Require]
[GrantedConditionReference]
[Desc("Condition to grant when docking.")]
public readonly string Condition = null;

public override object Create(ActorInitializer init) { return new GrantConditionOnDockingHarvester(init, this); }
}

public class GrantConditionOnDockingHarvester : INotifyHarvesterAction
{
readonly Harvester harvester;
readonly string conditionToGrant;
readonly Actor self;
int token = Actor.InvalidConditionToken;

public GrantConditionOnDockingHarvester(ActorInitializer init, GrantConditionOnDockingHarvesterInfo info)
{
conditionToGrant = info.Condition;
self = init.Self;
harvester = init.Self.Trait<Harvester>();
}

void INotifyHarvesterAction.MovingToResources(Actor self, CPos targetCell) { }
void INotifyHarvesterAction.MovingToRefinery(Actor self, Actor refineryActor) { }
void INotifyHarvesterAction.MovementCancelled(Actor self) { }
void INotifyHarvesterAction.Harvested(Actor self, string resourceType) { }

void INotifyHarvesterAction.Docked()
{
token = self.GrantCondition(conditionToGrant);
}

void INotifyHarvesterAction.Undocked()
{
if (token != Actor.InvalidConditionToken)
token = self.RevokeCondition(token);
}
}
}
100 changes: 100 additions & 0 deletions OpenRA.Mods.CA/Traits/Conditions/GrantConditionOnHarvesting.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
#region Copyright & License Information
/*
* Copyright 2007-2020 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, either version 3 of
* the License, or (at your option) any later version. For more
* information, see COPYING.
*/
#endregion

using System.Linq;
using OpenRA.Mods.Common.Traits;
using OpenRA.Traits;

namespace OpenRA.Mods.CA.Traits
{
public class GrantConditionOnHarvestingInfo : PausableConditionalTraitInfo, Requires<HarvesterInfo>
{
[FieldLoader.Require]
[GrantedConditionReference]
[Desc("Condition to grant while harvesting.")]
public readonly string Condition = null;

[Desc("Duration of harvesting condition.")]
public readonly int Duration = 10;

public override object Create(ActorInitializer init) { return new GrantConditionOnHarvesting(init, this); }
}

public class GrantConditionOnHarvesting : PausableConditionalTrait<GrantConditionOnHarvestingInfo>, ITick, ISync, INotifyCreated, INotifyHarvesterAction
{
readonly GrantConditionOnHarvestingInfo info;
readonly Harvester harvester;
readonly string conditionToGrant;
readonly Actor self;
int token = Actor.InvalidConditionToken;
IConditionTimerWatcher[] watchers;

[Sync]
public int Ticks { get; private set; }

public GrantConditionOnHarvesting(ActorInitializer init, GrantConditionOnHarvestingInfo info)
: base(info)
{
this.info = info;
conditionToGrant = info.Condition;
self = init.Self;
harvester = init.Self.Trait<Harvester>();
}

protected override void Created(Actor self)
{
watchers = self.TraitsImplementing<IConditionTimerWatcher>().Where(Notifies).ToArray();

base.Created(self);
}

void INotifyHarvesterAction.Harvested(Actor self, string resourceType)
{
if (token == Actor.InvalidConditionToken)
{
Ticks = info.Duration;
token = self.GrantCondition(conditionToGrant);
}
}

void RevokeCondition(Actor self)
{
if (token != Actor.InvalidConditionToken)
token = self.RevokeCondition(token);
}

void ITick.Tick(Actor self)
{
if (IsTraitDisabled && token != Actor.InvalidConditionToken)
RevokeCondition(self);

if (IsTraitPaused || IsTraitDisabled)
return;

foreach (var w in watchers)
w.Update(info.Duration, Ticks);

if (token == Actor.InvalidConditionToken)
return;

if (--Ticks < 1)
RevokeCondition(self);
}

void INotifyHarvesterAction.MovingToResources(Actor self, CPos targetCell) { }
void INotifyHarvesterAction.MovingToRefinery(Actor self, Actor refineryActor) { }
void INotifyHarvesterAction.MovementCancelled(Actor self) { }
void INotifyHarvesterAction.Docked() { }
void INotifyHarvesterAction.Undocked() { }

bool Notifies(IConditionTimerWatcher watcher) { return watcher.Condition == Info.Condition; }
}
}
File renamed without changes.
Binary file removed mods/ca/bits/chemtankpldicon.shp
Binary file not shown.
Binary file removed mods/ca/bits/chemtankreflectoricon.shp
Binary file not shown.
Binary file removed mods/ca/bits/fireballtankicon.shp
Binary file not shown.
Binary file removed mods/ca/bits/fireballtankpldicon.shp
Binary file not shown.
Binary file removed mods/ca/bits/fireballtankreflectoricon.shp
Binary file not shown.
Binary file removed mods/ca/bits/ivan.shp
Binary file not shown.
Binary file added mods/ca/bits/nod/chemtankicon.shp
Binary file not shown.
Binary file modified mods/ca/bits/soviet/crazyivan.shp
Binary file not shown.
Binary file modified mods/ca/bits/soviet/sovietminer.hva
Binary file not shown.
Binary file modified mods/ca/bits/soviet/sovietminer.vxl
Binary file not shown.
Binary file removed mods/ca/bits/soviet/sovietminer1section.vxl
Binary file not shown.
Binary file modified mods/ca/bits/soviet/sovietminerunload.vxl
Binary file not shown.
Binary file added mods/ca/bits/soviet/warminericon.shp
Binary file not shown.
74 changes: 4 additions & 70 deletions mods/ca/rules/commander-tree.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,12 @@ commander_tree.shielded_miners:
Prerequisites: prerequisite.has_points, ~structures.gdi, ~anypower
Description: Equips Miners with shield technology.

# filler for factions without miner upgrades
hack.cameo_filler.2:
Inherits: ^default.cameo_filler
Buildable:
BuildPaletteOrder: 2
Prerequisites: prerequisite.has_points, ~anypower, ~!structures.nod, ~!structures.gdi, disabled
BuildPaletteOrder: 5
Prerequisites: prerequisite.has_points, ~anypower, ~!structures.nod, ~!structures.gdi, ~!structures.soviet, disabled

# fillers for infantry upgrades - should be moved?
hack.cameo_filler.3:
Expand Down Expand Up @@ -1678,7 +1679,7 @@ hack.cameo_filler.209:
Inherits: ^default.cameo_filler
Buildable:
BuildPaletteOrder: 218
Prerequisites: prerequisite.has_points, ~vehicles.td, disabled
Prerequisites: prerequisite.has_points, ~vehicles.gdi, disabled

commander_tree.Medium_Tank_PLD:
Inherits: ^default.commander_tree_item
Expand Down Expand Up @@ -2229,73 +2230,6 @@ hack.cameo_filler.309:
BuildPaletteOrder: 318
Prerequisites: prerequisite.has_points, ~vehicles.nod, ~!vehicles.blackh, disabled

commander_tree.Flame_Tank.Reflector:
Inherits: ^default.commander_tree_item
Tooltip:
Name: Flame Tank Reflector Armor
Buildable:
Queue: Commander_Tree
BuildPaletteOrder: 319
ForceIconLocation: true
Prerequisites: prerequisite.has_points, ~vehicles.nod, techcenter, ~!commander_tree.flame_tank.pld
Description: Equips the Flame Tank with Reflector Armor. \n Very resistent vs. Energy Weapons.
ProvidesPrerequisite@filler:
Prerequisite: filler.flametank

commander_tree.Flame_Tank.PLD:
Inherits: ^default.commander_tree_item
Tooltip:
Name: Flame Tank Point Laser Defense System
Buildable:
Queue: Commander_Tree
IconPalette: chrometd
BuildPaletteOrder: 319
ForceIconLocation: true
Prerequisites: prerequisite.has_points, ~vehicles.nod, techcenter, ~!commander_tree.flame_tank.reflector
Description: Upgrades the Flame Tank with a Point Laser Defense System to shoot down incoming projectiles.
ProvidesPrerequisite@filler:
Prerequisite: filler.flametank

commander_tree.Chem_Tank:
Inherits: ^default.commander_tree_item
Tooltip:
Name: Chemical Tank
Buildable:
Queue: Commander_Tree
IconPalette: chrometd
BuildPaletteOrder: 320
ForceIconLocation: true
Prerequisites: prerequisite.has_points, ~vehicles.legion, techcenter, ~filler.flametank, ~!commander_tree.fireball_tank
Description: Upgrades the Flame Tank to a Chemical Tank improving its damage against armored targets.
ProvidesPrerequisite@filler:
Prerequisite: filler.flametank2

commander_tree.Fireball_Tank:
Inherits: ^default.commander_tree_item
Tooltip:
Name: Fireball Tank
Buildable:
Queue: Commander_Tree
IconPalette: chrometd
BuildPaletteOrder: 320
ForceIconLocation: true
Prerequisites: prerequisite.has_points, ~vehicles.blackh, techcenter, ~filler.flametank, ~!commander_tree.chem_tank
Description: Upgrades the Flame Tank to a Fireball Tank. \n It shoots fireballs with greater range, reducing the necessity to fight at very close range.
ProvidesPrerequisite@filler:
Prerequisite: filler.flametank2

hack.cameo_filler.311:
Inherits: ^default.cameo_filler
Buildable:
BuildPaletteOrder: 321
Prerequisites: prerequisite.has_points, ~vehicles.nod, disabled

hack.cameo_filler.312:
Inherits: ^default.cameo_filler
Buildable:
BuildPaletteOrder: 321
Prerequisites: prerequisite.has_points, ~vehicles.marked, ~filler.flametank, disabled

commander_tree.Stealth_Tank.AP:
Inherits: ^default.commander_tree_item
Tooltip:
Expand Down
39 changes: 38 additions & 1 deletion mods/ca/rules/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2141,6 +2141,30 @@ PROC.Dummy:
WithInfantryBody:
DefaultAttackSequence: shoot

^InfantrySwimmer:
Mobile:
Locomotor: seal
GrantConditionOnTerrain:
TerrainTypes: Water
Condition: onwater
WithInfantryBody:
RequiresCondition: !being-warped && !onwater
WithInfantryBody@Swim:
IdleSequences: swimidle1, swimidle2, swimcheer
StandSequences: swimidle1, swimidle2
-AttackSequences:
DefaultAttackSequence: swimattack
MoveSequence: swim
RequiresCondition: !being-warped && onwater
WithDeathAnimation:
RequiresCondition: !onwater
WithDeathAnimation@Water:
RequiresCondition: onwater
UseDeathTypeSuffix: False
FallbackSequence: splash
CrushedSequence: die-crushed
DeathSequence: swimdie1

^Ship:
Inherits@1: ^ExistsInWorld
Inherits: ^HeavyArmor
Expand Down Expand Up @@ -2168,6 +2192,7 @@ PROC.Dummy:
Inherits@production: ^ProductionEfficiencyBoost
Inherits@atomize: ^Atomizable
Inherits@C4: ^C4Plantable
Inherits@TNT: ^TNTPlantable
Inherits@minidrone: ^MiniDroneAttachable
Inherits@biodamage: ^DriverBiologicalDamage
Inherits@VehicleVision: ^VehicleVision
Expand Down Expand Up @@ -3961,8 +3986,20 @@ PROC.Dummy:

^VoxelHarvester:
Inherits: ^VoxelVehicle
-WithVoxelBody:
GrantConditionOnDockingHarvester:
Condition: docking
GrantConditionOnHarvesting:
Condition: harvesting
WithVoxelBody:
RequiresCondition: !docking && !harvesting
WithVoxelBody@docking:
Sequence: unload
RequiresCondition: docking
WithVoxelAnimatedBody:
RequiresCondition: harvesting
Inherits: ^Harvester
-WithHarvestAnimationCA:
-WithDockingAnimation:

^VoxelTurretedTank:
Inherits: ^TSRenderVoxel
Expand Down
Loading

0 comments on commit 7e795d8

Please sign in to comment.