civ4のタグがつけられたコード一覧

Python OACバグ修正//クラスチェンジ

		<SpellInfo>
			<Type>SPELL_CCADOL</Type>
			<Description>TXT_KEY_SPELL_CCADOL</Description>
			<Civilopedia>TXT_KEY_SPELL_PLACEHOLDER_PEDIA</Civilopedia>
			<Help>TXT_KEY_SPELL_CCADOL_HELP</Help>
			<Pronunciation>TXT_KEY_SPELL_CCADOL_PRONUNCIATION</Pronunciation>
			<PromotionPrereq1>PROMOTION_COMBAT5</PromotionPrereq1>
			<bInCityOnly>1</bInCityOnly>
			<bIgnoreHasCasted>1</bIgnoreHasCasted>
			<bHasCasted>0</bHasCasted>
			<bAbility>1</bAbility>
			<bBuffCasterOnly>1</bBuffCasterOnly>
			<PyResult>spellCCAdol</PyResult>
			<PyRequirement>reqCCAdol</PyRequirement>
			<bAllowAI>1</bAllowAI>
			<iAIWeight>300</iAIWeight>
			<PrereqOrUnits>
				<UnitType>UNIT_ADOL1</UnitType>
				<UnitType>UNIT_ADOL2</UnitType>
			</PrereqOrUnits>
			<bDisplayWhenDisabled>1</bDisplayWhenDisabled>
			<Effect>EFFECT_SPELL1</Effect>
			<Sound>AS3D_SPELL_HASTE</Sound>
			<bGraphicalOnly>1</bGraphicalOnly>
			<Button>Art_Kaijin/REAH/adol.dds</Button>
		</SpellInfo>

/////////////

def reqCCAdol(argsList):
	pCaster = argsList[0]
	pPlot = argsList[1]
	eSpell = argsList[2]

	iexp = pCaster.getExperience()
	if iexp > 99:
		return True
	return False

def spellCCAdol(argsList):
	pCaster = argsList[0]
	pBestPlot = argsList[1]
	eSpell = argsList[2]

	iPlayer = pCaster.getOwner()
	iCasterID = pCaster.getID()
	pPlayer = gc.getPlayer(iPlayer)
	if pPlayer.isHuman():
		popupInfo = CyPopupInfo()
		popupInfo.setButtonPopupType(ButtonPopupTypes.BUTTONPOPUP_PYTHON)
		popupInfo.setText(CyTranslator().getText("TXT_KEY_POPUP_CCADOL",()))
		popupInfo.setData1(iPlayer)
		popupInfo.setData2(iCasterID)
		popupInfo.setPythonModule("CvSpellInterface")
		popupInfo.setOnClickedPythonCallback("selectCCAdol")
		popupInfo.addPythonButton(CyTranslator().getText("TXT_KEY_POPUP_YES", ()), "")
		popupInfo.addPythonButton(CyTranslator().getText("TXT_KEY_POPUP_NO", ()), "")
		popupInfo.addPopup(iPlayer)
	else:
		applyCCAdol(iPlayer, iCasterID)

def selectCCAdol(argsList):
	iButton = argsList[0]
	iPlayer = argsList[1]
	iCasterID = argsList[2]

	if iButton == 0:
		applyCCAdol(iPlayer, iCasterID)

def applyCCAdol(iPlayer, iCasterID):
	iCombat1 = gc.getInfoTypeForString('PROMOTION_COMBAT1')
	iCombat2 = gc.getInfoTypeForString('PROMOTION_COMBAT2')
	iCombat3 = gc.getInfoTypeForString('PROMOTION_COMBAT3')
	iCombat4 = gc.getInfoTypeForString('PROMOTION_COMBAT4')
	iCombat5 = gc.getInfoTypeForString('PROMOTION_COMBAT5')

	pPlayer = gc.getPlayer(iPlayer)
	pCaster = pPlayer.getUnit(iCasterID)
	pPlot = pCaster.plot()
	if pCaster.getUnitType() == gc.getInfoTypeForString('UNIT_ADOL1'):
		iCha = gc.getInfoTypeForString('PROMOTION_CHANNELING1')
		iUnit = gc.getInfoTypeForString('UNIT_ADOL2')
	elif pCaster.getUnitType() == gc.getInfoTypeForString('UNIT_ADOL2'):
		iCha = gc.getInfoTypeForString('PROMOTION_CHANNELING2')
		iUnit = gc.getInfoTypeForString('UNIT_ADOL3')
	CyInterface().addMessage(pCaster.getOwner(),True,25,CyTranslator().getText("TXT_KEY_MESSAGE_ADOL", ()),'AS2D_REVOLTEND',1,'Art_Kaijin/REAH/adol.dds',ColorTypes(8),pCaster.getX(),pCaster.getY(),True,True)
	if pPlot.isVisibleToWatchingHuman():
		CyEngine().triggerEffect(gc.getInfoTypeForString('EFFECT_PILLAR_OF_FIRE'),pPlot.getPoint())
	pNewUnit = pPlayer.initUnit(iUnit, pCaster.getX(), pCaster.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
	pNewUnit.convert(pCaster)
	pNewUnit.setHasPromotion(iCha, True)
	pNewUnit.setHasPromotion(iCombat1, False)
	pNewUnit.setHasPromotion(iCombat2, False)
	pNewUnit.setHasPromotion(iCombat3, False)
	pNewUnit.setHasPromotion(iCombat4, False)
	pNewUnit.setHasPromotion(iCombat5, False)
	pNewUnit.setLevel(1)
	pNewUnit.setExperience(0, -1)

def enabledYsEventBuyWeapon(argsList):
	pCaster = argsList[0]
	pPlot = argsList[1]
	eSpell = argsList[2]

	pPlayer = gc.getPlayer(pCaster.getOwner())

	rate = (100 + pPlayer.calculateInflationRate()) / 100
	iGoldLow = 50 * rate
	iGoldMid = 200 * rate
	iGoldHigh = 1600 * rate
	iGoldNeckless = 100 * rate
	iGoldPlayer = pPlayer.getGold()

	if not pCaster.isHuman():
		if iGoldPlayer >= iGoldLow:
			if not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSSWORD3')):
				if pPlayer.getNumAvailableBonuses(gc.getInfoTypeForString('BONUS_COPPER')) > 0:
					if iGoldPlayer >= iGoldHigh:
						return True
					if iGoldPlayer >= iGoldMid and not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSSWORD2')):
						return True
				if (not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSSWORD2'))
					and not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSSWORD1'))	):
					return True
			if not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSARMOR3')):
				if pPlayer.getNumAvailableBonuses(gc.getInfoTypeForString('BONUS_MARBLE')) > 0:
					if iGoldPlayer >= iGoldHigh:
						return True
					if iGoldPlayer >= iGoldMid and not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSARMOR2')):
						return True
				if (not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSARMOR2'))
					and not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSARMOR1'))	):
					return True
			if not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSSHIELD3')):
				if pPlayer.getNumAvailableBonuses(gc.getInfoTypeForString('BONUS_GOLD')) > 0:
					if iGoldPlayer >= iGoldHigh:
						return True
					if iGoldPlayer >= iGoldMid and not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSSHIELD2')):
						return True
				if (not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSSHIELD2'))
					and not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSSHIELD1'))	):
					return True
			if (not pCaster.isHasPromotion(gc.getInfoTypeForString('PROMOTION_YSNECKLESS'))
				and pPlayer.getNumAvailableBonuses(gc.getInfoTypeForString('BONUS_GEMS')) > 0
				and iGoldPlayer >= iGoldNeckless											):
				return True
		return False
	return True

Python OACMODMOD//話術志向における態度好転を途中参加の文明にも通じるように変更

	def onFirstContact(self, argsList):
		'Contact'
		iTeamX, iHasMetTeamY = argsList
# mod ent >>>
		# TRAIT_SPEECH
		pTeamX = gc.getTeam(iTeamX)
		for iLoopPlayerX in xrange(gc.getMAX_CIV_PLAYERS()):
			pLoopPlayerX = gc.getPlayer(iLoopPlayerX)
			if pLoopPlayerX.isAlive():
				if pLoopPlayerX.hasTrait(gc.getInfoTypeForString('TRAIT_SPEECH')):
					iLoopTeamX = pLoopPlayerX.getTeam()
					if iLoopTeamX == iTeamX:
						pTeamY = gc.getTeam(iHasMetTeamY)
						for iLoopHasMetPlayerY in xrange(gc.getMAX_CIV_PLAYERS()):
							pLoopHasMetPlayerY = gc.getPlayer(iLoopHasMetPlayerY)
							if pLoopHasMetPlayerY.isAlive():
								iLoopHasMetTeamY = pLoopHasMetPlayerY.getTeam()
								if iLoopHasMetTeamY == iHasMetTeamY:
									pLoopHasMetPlayerY.AI_changeAttitudeExtra(iLoopPlayerX, 6)
# mod <<<
		if (not self.__LOG_CONTACT):
			return
		CvUtil.pyPrint('Team %d has met Team %d' %(iTeamX, iHasMetTeamY))

よく投稿されているコード

タグ

最近投稿されたコード