Help Extracting Fort Commander Code

I went with an archery theme, actually inspired by one of my favorite M:tG cards. The unit is called the Sagittar, and uses the Ljo Longbowman graphics instead of the regular FC graphics (I have zero skill at doing artwork, so...). Instead of the Siegecombat promo, it has a similar promo that does basically the same thing but additionally allows it to promote to the Archery promos. I also decided to have it start with Woodsman I; was considering allowing it to promote to Woodsman II, but that seemed too much.

Ranged combat wise, it loses the ability to deal collateral damage, but has the potential to get a much higher ranged attack power against single units, thanks to the Archery promotions. I also gave it a 2-square range, which adds another layer of strategy to deciding where to place them, since you want to put them somewhere where their full range won't be blocked by high terrain.

"What's their strike range, you ask? Let's put it this way: sagittars aim their bows using maps."
—Otak, Tin Street shopkeep

Originally I was going to give them a unique replacement for the Commander I, II, III line of promotions that increased their range as they leveled up - starting them with normal 1-square range, bumping it to 2 at Commander I, and possibly even up to 3 at Commander III (in my version I enabled Commander III for everyone, instead of just the Kuriotates). However, I discovered that there is currently no way to increase ranged combat attack range through promotions, which struck me as a bit odd.

I've also done fort commanders for the Sheaim, Bannor, and Chislev so far if you are interested in hearing those; perhaps in return you could share any ideas you have for a FC for the Lizardmen, Dural, or Archos, because those seem like they should have them, but I am completely stumped as to what they should be. XD
 
I went with an archery theme, actually inspired by one of my favorite M:tG cards. The unit is called the Sagittar, and uses the Ljo Longbowman graphics instead of the regular FC graphics (I have zero skill at doing artwork, so...). Instead of the Siegecombat promo, it has a similar promo that does basically the same thing but additionally allows it to promote to the Archery promos. I also decided to have it start with Woodsman I; was considering allowing it to promote to Woodsman II, but that seemed too much.

Ranged combat wise, it loses the ability to deal collateral damage, but has the potential to get a much higher ranged attack power against single units, thanks to the Archery promotions. I also gave it a 2-square range, which adds another layer of strategy to deciding where to place them, since you want to put them somewhere where their full range won't be blocked by high terrain.

"What's their strike range, you ask? Let's put it this way: sagittars aim their bows using maps."
—Otak, Tin Street shopkeep

Originally I was going to give them a unique replacement for the Commander I, II, III line of promotions that increased their range as they leveled up - starting them with normal 1-square range, bumping it to 2 at Commander I, and possibly even up to 3 at Commander III (in my version I enabled Commander III for everyone, instead of just the Kuriotates). However, I discovered that there is currently no way to increase ranged combat attack range through promotions, which struck me as a bit odd.

I've also done fort commanders for the Sheaim, Bannor, and Chislev so far if you are interested in hearing those; perhaps in return you could share any ideas you have for a FC for the Lizardmen, Dural, or Archos, because those seem like they should have them, but I am completely stumped as to what they should be. XD

Sounds good... I didn't have any specific idea for them, although a Fawn/Treant/Guardian Vine was suggested. I think I'll use your version. :lol:

Commander 3 is used for Kuriotates and the Khazad... Or rather, the Legendary Influence promo it allows. The Khazad have Dwarven Commander 3. :lol: I just don't think EVERY civ should have two tiers of range on them... The Kuriotates because eventually I'd like the forts to replace settlements, and the Khazad to represent the fact that their forts are nearly cities in their own right. :lol: I could see adding it to a few others (Austrin, for their tracking and knowledge of the land, for example), but not everyone.

As for increasing range... <iAirRangeChange>1</iAirRangeChange>. I used it for the siege promotions.

As for Fort Commander UU's... I actually started a thread for people to post in, and it's generated quite a few ideas. :lol: You should post your own, and possibly use some other people have posted.

http://forums.civfanatics.com/showthread.php?t=332268
 
Commander 3 is used for Kuriotates and the Khazad... Or rather, the Legendary Influence promo it allows. The Khazad have Dwarven Commander 3. :lol: I just don't think EVERY civ should have two tiers of range on them... The Kuriotates because eventually I'd like the forts to replace settlements, and the Khazad to represent the fact that their forts are nearly cities in their own right. :lol: I could see adding it to a few others (Austrin, for their tracking and knowledge of the land, for example), but not everyone.
~shrugs~ Personal preference thing. I actually made fort commanders on the whole a fair bit stronger than they are in FF+ (they get the Commander promotions each 1 level earlier, and Influence gives +.30 XP rate in addition to +60 XP limit); on the flip side, I am considering either making Claim Fort have a gold cost, or giving fort commanders a gold-per-turn cost.

Ironically the thing that bothers me most about the legendary influence level is that it is not BFC shaped. XD I don't suppose there would be any easy way to "cut the corners" off the legendary influence range? It's probably a lot of coding for little return, but it really does bother me and I am kinda obsessive/compulsive about that kind of thing. :)

As for increasing range... <iAirRangeChange>1</iAirRangeChange>. I used it for the siege promotions.
Interesting. That field doesn't seem to be listed in the dummy promotion that is supposed to have all fields; guess I should have checked the schema.

As for Fort Commander UU's... I actually started a thread for people to post in, and it's generated quite a few ideas. :lol: You should post your own, and possibly use some other people have posted.

http://forums.civfanatics.com/showthread.php?t=332268
Cool, I'll check that out.
 
I just can't think of an easy way to set the cross...

You could look at the code for vitalize.

The purpose of the plotsInRange is to replace code like:
Code:
for iXLoop in range(iX-2, iX+3):
    for iYLoop in range(iY-2, iY+3):
        do_stuff(iXLoop, iYLoop)

with
Code:
for iXLoop, iYLoop in plotsInRange( iX, iY, 2 ):
    do_stuff(iXLoop, iYLoop)

and automatically making it circleish shaped.

It doesn't ensure that the coordinate is on the map, so that has to be done in the loop. Vitalize seems to get by with a simple "not pPlot.isNone()", so I think the map normalises coordinates outside the map. I haven't done any extensive testing though.

Code:
def plotsInRange( centerX, centerY, maxRange, minRange=None ):
    maxRangeSquared = (maxRange+.5)**2
    if minRange is None:
        minRangeSquared = -1
    else:
        minRangeSquared = (minRange+.5)**2
    for offsetX in xrange( -maxRange, maxRange+1 ):
        for offsetY in xrange( -maxRange, maxRange+1 ):
            if minRangeSquared < offsetX**2 + offsetY**2 < maxRangeSquared:
                yield ( centerX + offsetX, centerY + offsetY )
 
Back
Top Bottom