[Freeciv-Dev] Unit Abilities (Upkeep, Flags)
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
I was adding some undead to units.ruleset for my fantasy modpack, and I
thought "Wouldn't it be cool if the undead didn't need upkeep in shields?
I wonder if I can do it?" Checking through to see exactly what happens if
I set F_NONMIL on a unit with attack strength > 0 ...
0) AI is bound to get confused. (I'll take this a given)
1) they don't cost shields to upkeep (cool)
2) they don't cost food either, since they aren't F_SETTLERS (good)
3) under democracy/republic, they still count as agressive for making
people unhappy. (fair enough)
4) doesn't count towards how militarized you are (shrug)
5) can't auto-attack (hmmm... maybe mindless zombies need orders)
6) can't capture cities (I can live with this - they are fine in a fight,
but no good for more complex tasks)
7) it can't attack. D'oh!
in server/unittools.c:
/******
unit can't attack if:
1) it don't have any attack power
...
*******/int can_unit_attack_unit_at_tile(...)
{
...
if(!is_militarty_unit(punit))
return 0;
...
Either the comment should change, or the code should be something more
like
if(get_unit_type(punit->type)->attack_strength == 0)
return 0;
Now we get to Dwarves. They're basically Engineers. They have F_TRANSFORM,
and I'd like them to be able to irrigate, mine, road and railroad, but not
build cities. No way to do this, as all of these are covered by F_SETTLERS.
It'd be nice to separate them - but I'm trying to make a working ruleset
first - changing the code comes later. I was planning on giving them an
attack power of 1, and not F_NONMIL. Now odd things happen if you have a
unit with F_SETTLERS but not F_NONMIL. It costs not only shields, but food
as well (depends on govt type of course).
There seems to be 4 basic types of upkeep for units:
Shields: if ! F_NONMIL
Food: if F_SETTLERS
Happiness: if (attack_strength != 0) && ! (in city || in fortress near
city)
Gold: If you are a city improvement :)
the upkeep is then modified by the type of government.
It'd be nice to be able to specify which sorts of upkeep apply to which
units.
So a battleship might have an upkeep of 1 gold, in addition to it's 1
shield,
and a baby-eating demons might cause twice the normal happiness penalty.
Settlers
need food, but dwarves only need shields (however they do count as
agressive)
; name upk
"Battleship" "sgh"
"Baby-Eaters" "shh"
"Settlers" "f"
"Dwarves" "sh"
Basically, I'm letting you know some of the things I'm finding that I think
would be fun to look at when I finish my modpack. I'm guessing that will be
in
a couple of weeks to a couple of months, probably depending on what I do
about
graphics.
Mark
- [Freeciv-Dev] Unit Abilities (Upkeep, Flags),
Mark Nettle <=
|
|