MaxAstro
Spiral Knight
- Joined
- Dec 18, 2007
- Messages
- 645
I am trying to implement the Necrototem as an actual, randomly generated wilderness feature. However, the Necrototem code currently has a bit of a glitch in it: The fear code will occasionally send the frightened unit to another tile adjacent to the totem, defeating the point of that bit of code.
Can anyone take a look at this code and tell me how to make pPlot2 always be a clear plot that is not adjacent to any IMPROVEMENT_NECROTOTEM? I can do a bit of python, but this one has me stumped...
Can anyone take a look at this code and tell me how to make pPlot2 always be a clear plot that is not adjacent to any IMPROVEMENT_NECROTOTEM? I can do a bit of python, but this one has me stumped...
Code:
def atRangeNecrototem(pCaster, pPlot):
if pCaster.isImmuneToFear() == False:
pPlot2 = findClearPlot(-1, pCaster.plot())
if pPlot2 != -1:
pCaster.setXY(pPlot2.getX(), pPlot2.getY(), false, true, true)
CyInterface().addMessage(pCaster.getOwner(),True,25,CyTranslator().getText("TXT_KEY_MESSAGE_NECROTOTEM", ()),'',1,'Art/Interface/Buttons/Improvements/Necrototem.dds',ColorTypes(8),pPlot2.getX(),pPlot2.getY(),True,True)