"Blood" traits

Information and discussion for custom maps and mods.
Post Reply
lucassss
Posts: 144
Joined: Mon Jan 04, 2016 1:55 pm

"Blood" traits

Post by lucassss »

I've implemented these for something in Shattered Paradise, but I think it may be of interest in general, so I'm publishing this here as well.

I've created two new Traits for OpenRA: BloodCashTrickler and GivesBloodBounty.

The BloodCashTrickler trait makes a structure gain money for its owner for every unit that died in its range. It accepts two parameters:
Delay - how much time passes between the death and the money it brings.
Percentage - How many percents of the value of the killed unit does the owner get. Note that BloodCashTrickler doesn't work for all units, but only for units that have the GiveBloodBounty trait. Also, due to either engine limitations or my limitations, range is currently hard coded to 7.

This can be useful for two things:
1) Creation of a 'Blood Derrick'. Think about how people fight for oil derricks at the beginning, only that here there's an element of "Gambler's ruin", how many people do you send to fight for the derrick? What if you lost? Do you send more and take a risk? Or just give up?
2) Creation of an "economic defense" structure. Imagine some kind of a tower that doesn't attack, but instead allows the defending side to get back some of the money it lost by defending itself.

Note that this has a chance of being OP, so I think that (1) should have only 1 or 2 instances in a single map, preferrably NOT on a chokepoint, and (2) should be require some tech, either t2 or t3.

Anyhow, here's the code for the traits:
http://pastebin.com/EcEPGBWX
http://pastebin.com/k5RqtMnQ

User avatar
Graion Dilach
Posts: 274
Joined: Fri May 15, 2015 5:57 pm

Post by Graion Dilach »

The idea is great, but a lot of the implementation details can be made better. So I went ahead and rewritten it to something much more OpenRA-compatible in https://github.com/GraionDilach/OpenRA. ... 5598476dcf sorry about that.

Even without using the the proximity trigger system (used at ProximityCapture - King of the Hill - and UpgradeActorsNear), you could have used World.FindActorsInCircle instead of looking up the tiles even.
Image
Image
Image
AS Discord server: https://discord.gg/7aM7Hm2

Post Reply