A Little Slice Of Heaven

How would it flood its banks? Like, gameplay-wise? :S
 
Ahh, with floodplains around it, I get it now =]

In other news whatever, if mana happened to be in water, is there any way to get it? Perhaps fishing boats could construct watery roads or something?
 
Yeah. I will when I add that in. Probably going to be a FA thing though.
 
Ideas!

Creation: Slightly increase resource spread chance in radius.
Body: Attack strength bonus to units in radius.
Spirit: Tricky one. Small chance for Spirit Guide, maybe?
Earth: Defense strength bonus to units in radius.
Air: Units within radius pick up +1 movement, similar to how Hauntstalk works in Haunted Lands.
 
Wow!

I'm currently playing a game as the Amurites. A little barb city is just outside my borders, no problem, they aren't no threat. Then, hell starts spreading from the Entropy Mana in their borders. I'm now in a race to get to Sorcery and Dispel Magic before my capital is surrounded with hell! :eek:

The Svarts have two sources of nature mana in their lands, and already have a couple of Ancient Forests. Same with the Jotnar and the Kuriotates. The Doviello have a little desert in the middle of their arctic lands... :lol:

And, the source of Death Mana just in my borders is threatning to turn all my forests into Haunted Lands if I ever connect it. Looks like I'm in for an interesting game.
 
Well, I have a little python problem with making the range it affects changes depending on what improvement is built on it. I have re-coded death, coded mind, fire and sun.

I don't know whether to release without the better ranges or not? What do you lot think?
 
Well, I have a little python problem with making the range it affects changes depending on what improvement is built on it. I have re-coded death, coded mind, fire and sun.

I don't know whether to release without the better ranges or not? What do you lot think?

I looked at your code and found:

Code:
def FatCrossShape( 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 )

However, you don't use it. Possibly because you placed it as a method of the superfluous class ManaIsShiny .

If you make FatCrossShape a function at module level instead you could replace for instance the Ice mana with:
Code:
# ICE MANA
if iBonus == iIceMana:
    iX = pPlot.getX()
    iY = pPlot.getY()
    for iiX, iiY in FatCrossShape( iX, iY, 2):
        pPlot = getPlot(iiX,iiY)
        tempRand = randNum(100, "ChangeChance")
        if ( tempRand < 3 ) :
            if not pPlot.isNone():
                if not pPlot.isWater():
                    if pPlot.getTerrainType() != iSnow:
                        pPlot.setTerrainType(iSnow,True,True)
            if pPlot.isWater():
                if pPlot.getFeatureType() != iIce:
                    pPlot.setFeatureType(iIce,0)
        elif (tempRand<31) :
            if not pPlot.isNone():
                if not pPlot.isWater():
                    if pPlot.getTerrainType() != iSnow:
                        iRnd = randNum(12, "Snowfall") + 6
                        pPlot.setTempTerrainType(iSnow, iRnd)
            if pPlot.isWater():
                if pPlot.getFeatureType() != iIce:
                    pPlot.setTempFeatureType(iIce, 0, randNum(5, "Bob") + 10)

Then it would be easy to change the range. You could even make circles easily with a fourth argument to FatCrossShape .

---

In fact, I think you should make ManaIsShiny.ManaIsShiny a module level function, drop the self argument that you never use, remove the empty ManaIsShiny class and remove the line
Code:
ManaIsShiny = ManaIsShiny.ManaIsShiny()			#Added in Mana Is Shiny mod: lemonjelly
from CvEventManager.py .

I attached an example revision.
 

Attachments

Well... urm... first, THANKS :D :D :D

Second, what I was trying to do was make:
Spoiler :
Mana without a node
x.x.x
x.o.x
x.x.x

With a node.
x.x.x.x.x
x.x.x.x.x
x.x.o.x.x
x.x.x.x.x
x.x.x.x.x

With a Unique Feature that has mana attached.
x.x.x.x.x.x.x
x.x.x.x.x.x.x
x.x.x.x.x.x.x
x.x.x.o.x.x.x
x.x.x.x.x.x.x
x.x.x.x.x.x.x
x.x.x.x.x.x.x


-----

Obviously, I had the def FatCrossShape, but I didn't know how to use it, so that's why I didn't use it. With your code, could you change one, I don't really mind which, to make the shapes like this:
Spoiler :

Mana without a node
x.x.x
x.o.x
x.x.x

With a node.
n.x.x.x.n
x.x.x.x.x
x.x.o.x.x
x.x.x.x.x
n.x.x.x.n

With a Unique Feature that has mana attached.
n.n.x.x.x.n.n
n.x.x.x.x.x.n
x.x.x.x.x.x.x
x.x.x.o.x.x.x
x.x.x.x.x.x.x
n.x.x.x.x.x.n
n.n.x.x.x.n.n


Basically, if you could do that, I could C+P it to all of my other Mana effects. If you can't, then, that isn't a problem either, I'll just use your code for the BFC.

-----

In fact, I think you should make ManaIsShiny.ManaIsShiny a module level function, drop the self argument that you never use, remove the empty ManaIsShiny class and remove the line
Urm... I'm not too sure what your taking about... (Bolded the bit that really confused me)
And, remove that line and replace it with what? Surely it won't work without it?
Sorry, I'm not the best person when it comes to python.

Code:
            for iiX, iiY in FatCrossShape( iX, iY, [B]2[/B]):
Why did you change it to 2? Is there a reason?
 
Obviously, I had the def FatCrossShape, but I didn't know how to use it, so that's why I didn't use it. With your code, could you change one, I don't really mind which, to make the shapes like this:
Spoiler :

Mana without a node
x.x.x
x.o.x
x.x.x

With a node.
n.x.x.x.n
x.x.x.x.x
x.x.o.x.x
x.x.x.x.x
n.x.x.x.n

With a Unique Feature that has mana attached.
n.n.x.x.x.n.n
n.x.x.x.x.x.n
x.x.x.x.x.x.x
x.x.x.o.x.x.x
x.x.x.x.x.x.x
n.x.x.x.x.x.n
n.n.x.x.x.n.n

Assuming the 'n' is supposed to mark unaffected tiles, much of the purpose of FatCrossShape is to get those shapes easily. The other purpose is easier to read and graceful behaviour for large ranges.

Code:
            for iiX, iiY in FatCrossShape( iX, iY, [B]2[/B]):
Why did you change it to 2? Is there a reason?

The 2 is the range of the fat cross. 0 would be just the square (iX,iY), 1 includes the eight surrounding squares too, 3 is the same as a Kuoriates city.


FatCrossShape( iX, iY, 10 ) would be a huge disk shaped area centred at (iX, iY) with radius 10.
FatCrossShape( iX, iY, 10, 8 ) would be a roughly 2 tiles wide circle centred at (iX, iY) with radius 10. A disk with a hole in the middle.



---

Add this to the parts where you declare local variables before the loop:
Code:
manaStrings = ['MIND', 'ICE', 'DEATH', 'NATURE', 'LIFE', 'ENTROPY', 'ENCHANTMENT', 'METAMAGIC', 'AIR', 'BODY', 'CHAOS', 'EARTH', 'FIRE', 'LAW', 'SHADOW', 'SPIRIT', 'SUN', 'WATER', ]    
manaNodes = set( getInfoType('IMPROVEMENT_MANA_' + mana) for mana in manaStrings )
It's to get all the mana node improvements into a set for quick comparison.


Code:
# ICE MANA
if iBonus == iIceMana:
    iX = pPlot.getX()
    iY = pPlot.getY()
[B]    if iImprovement in manaNodes:
        maxRange = 2
    elif gc.getImprovementInfo(iImprovement).isUnique():
        maxRange = 3
    else:
        maxRange = 1
    for iiX, iiY in FatCrossShape( iX, iY, maxRange ):[/B]
        pPlot = getPlot(iiX,iiY)
        tempRand = randNum(100, "ChangeChance")
        if ( tempRand < 3 ) :
            if not pPlot.isNone():
                if not pPlot.isWater():
                    if pPlot.getTerrainType() != iSnow:
                        pPlot.setTerrainType(iSnow,True,True)
            if pPlot.isWater():
                if pPlot.getFeatureType() != iIce:
                    pPlot.setFeatureType(iIce,0)
        elif (tempRand<31) :
            if not pPlot.isNone():
                if not pPlot.isWater():
                    if pPlot.getTerrainType() != iSnow:
                        iRnd = randNum(12, "Snowfall") + 6
                        pPlot.setTempTerrainType(iSnow, iRnd)
            if pPlot.isWater():
                if pPlot.getFeatureType() != iIce:
                    pPlot.setTempFeatureType(iIce, 0, randNum(5, "Bob") + 10)

---

Urm... I'm not too sure what your taking about... (Bolded the bit that really confused me)
And, remove that line and replace it with what? Surely it won't work without it?
Sorry, I'm not the best person when it comes to python.

Each python file is called a module and you don't need to place functions in classes to use them. (Unlike in java where each file is a class and functions must be methods of classes.)

If you look in the previous attachment, you'll see how it looks without being in a class. Basically you save an indentation level and you don't have to start the function arguments with self .

It's not very important, many other files also use superfluous classes.
 
OMG! Thanks so much!

I already have all the mana nodes listed, but I done it by hand...
...same with Unique Improvements...
...if only I had that way...
Thanks, I'll do this, do a quick test to see whether the shapes are right, then I can post version 1.00 =]
 
Urm, I added in that code, all works well apart Death mana doesn't change forests into haunted lands and the range doesn't change at all, just the one ring around the mana.

http://pastebin.com/f1cdcad55

I kept it in class ManaIsShiny because I can't see any benefit from spending 5min going through deleting one tab from every line :P
 
Urm, I added in that code, all works well apart Death mana doesn't change forests into haunted lands and the range doesn't change at all, just the one ring around the mana.

It's basically the same error.

pPlot.getImprovementType() returns an integer, the internal name Civ uses. You check against strings, 'IMPROVEMENT_MANA_AIR' for instance.

That is what the function gc.getInfoTypeForString is for, translating from string form to integer form.

Replace the long line
Code:
iNode = ['IMPROVEMENT_MANA_DIMENSIONAL','IMPROVEMENT_MANA_AIR','IMPROVEMENT_MANA_BODY','IMPROVEMENT_MANA_CHAOS','IMPROVEMENT_MANA_DEATH','IMPROVEMENT_MANA_EARTH','IMPROVEMENT_MANA_ENCHANTMENT','IMPROVEMENT_MANA_ENTROPY','IMPROVEMENT_MANA_FIRE','IMPROVEMENT_MANA_FORCE','IMPROVEMENT_MANA_ICE','IMPROVEMENT_MANA_LAW','IMPROVEMENT_MANA_LIFE','IMPROVEMENT_MANA_METAMAGIC','IMPROVEMENT_MANA_MIND','IMPROVEMENT_MANA_NATURE','IMPROVEMENT_MANA_SHADOW','IMPROVEMENT_MANA_SPIRIT','IMPROVEMENT_MANA_SUN','IMPROVEMENT_MANA_WATER','IMPROVEMENT_MANA_CREATION']

with
Code:
iNode = [getInfoType('IMPROVEMENT_MANA_DIMENSIONAL'), getInfoType(' ... ]

Also, since you are only going to be testing if the improvement is in the collection, use a set.
Code:
iNode = set([getInfoType('IMPROVEMENT_MANA_DIMENSIONAL'), getInfoType(' ... ])

Forests doesn't change because once again you are comparing to strings, just remove the ' from the names of the already translated features.

I made the changes here. In my own lazy way.

I kept it in class ManaIsShiny because I can't see any benefit from spending 5min going through deleting one tab from every line :P

True, there isn't.

Good editors, like Notepad++ or Stani's Python Editor will allow you to select several lines and then de-indent (or indent) them all. Usually by pressing shift-tab (or tab). But even then there isn't much point as long as it works.
 
Thanks, it all works perfectly.

Uploaded version 1.0 :D
 
in retrospection now i think, that mind mana is overpowered, especially if you are charismatic
level 6 unit in less than 40 turns => archmage/high priest in less than 40 turns => dear lord .. :D
 
What are the xp/level ratios for Charismatic and Normal?
NRML..2..5..10
LVLS...1..2...3
CHRS..
I don't know the Charismatic ones, or the rest of the normal ones...

In the Amurite game mentioned above, the Tower Of Eyes allowed my capital to defend against barbs pretty well.
What Xp/Turn and Max XP from it should I have?
 
What are the xp/level ratios for Charismatic and Normal?
NRML..2..5..10
LVLS...1..2...3
CHRS..
I don't know the Charismatic ones, or the rest of the normal ones...

Code:
level  xp  Charismatic
2       2   1.5
3       5   3.75
4      10   7.5
5      17  12.75
6      26  19.5

Experience needed for next level is: current level*current level +1
Charismatic deducts 25%.

Maybe it shouldn't be xp/turn, just give enough xp to reach next level when the unit only needs 2.
 
That seems complex..

Hmm... I could reduce it down to 0.25 a turn until 10xp then 0.125 a turn until 20xp, making it take AGES to do anything.

Or, make it even lower than that?

Would that solve the problem?
 
So, anybody played any games with this yet?
 
Back
Top Bottom