Mr_Yamamotoさんが投稿したコード一覧

XML 村の建設

CIV4BuildInfos.xml
		<BuildInfo>
			<Type>BUILD_VILLAGE</Type>
			<Description>TXT_KEY_BUILD_VILLAGE</Description>
			<Help/>
			<PrereqTech>TECH_MERCANTILISM</PrereqTech>
			<iTime>800</iTime>
			<iCost>0</iCost>
			<bKill>0</bKill>
			<ImprovementType>IMPROVEMENT_VILLAGE</ImprovementType>
			<RouteType>NONE</RouteType>
			<EntityEvent>ENTITY_EVENT_BUILD</EntityEvent>
			<FeatureStructs>
				<FeatureStruct>
					<FeatureType>FEATURE_JUNGLE</FeatureType>
					<PrereqTech>TECH_MASONRY</PrereqTech>
					<iTime>800</iTime>
					<iProduction>20</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
				<FeatureStruct>
					<FeatureType>FEATURE_FOREST</FeatureType>
					<PrereqTech>TECH_CRAFTING</PrereqTech>
					<iTime>500</iTime>
					<iProduction>30</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
				<FeatureStruct>
					<FeatureType>FEATURE_FOREST_ANCIENT</FeatureType>
					<PrereqTech>TECH_CRAFTING</PrereqTech>
					<iTime>1000</iTime>
					<iProduction>60</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
				<FeatureStruct>
					<FeatureType>FEATURE_FOREST_NEW</FeatureType>
					<PrereqTech>TECH_CRAFTING</PrereqTech>
					<iTime>0</iTime>
					<iProduction>0</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
				<FeatureStruct>
					<FeatureType>FEATURE_FOREST_BLIGHTED</FeatureType>
					<PrereqTech>TECH_CRAFTING</PrereqTech>
					<iTime>250</iTime>
					<iProduction>0</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
				<FeatureStruct>
					<FeatureType>FEATURE_FOREST_BURNT</FeatureType>
					<PrereqTech>TECH_CRAFTING</PrereqTech>
					<iTime>250</iTime>
					<iProduction>0</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
				<FeatureStruct>
					<FeatureType>FEATURE_DEEP_JUNGLE</FeatureType>
					<PrereqTech>TECH_MASONRY</PrereqTech>
					<iTime>1000</iTime>
					<iProduction>30</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
				<FeatureStruct>
					<FeatureType>FEATURE_SCRUB</FeatureType>
					<PrereqTech>TECH_CRAFTING</PrereqTech>
					<iTime>250</iTime>
					<iProduction>10</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
				<FeatureStruct>
					<FeatureType>FEATURE_SWAMP</FeatureType>
					<PrereqTech>TECH_MASONRY</PrereqTech>
					<iTime>1000</iTime>
					<iProduction>0</iProduction>
					<bRemove>1</bRemove>
				</FeatureStruct>
			</FeatureStructs>
			<HotKey>KB_T</HotKey>
			<bAltDown>0</bAltDown>
			<bShiftDown>0</bShiftDown>
			<bCtrlDown>0</bCtrlDown>
			<iHotKeyPriority>0</iHotKeyPriority>
			<Button>,Art/Interface/Buttons/Builds/BuildVillage.dds,Art/Interface/Buttons/Actions_Builds_LeaderHeads_Specialists_Atlas.dds,5,9</Button>
		</BuildInfo>

CIV4UnitInfos.xml
				<Build>
					<BuildType>BUILD_VILLAGE</BuildType>
					<bBuild>1</bBuild>
				</Build>

text.xml
	<TEXT>
		<Tag>TXT_KEY_BUILD_VILLAGE</Tag>
		<English>Build Village</English>
		<French/>
		<German/>
		<Italian/>
		<Spanish/>
		<Japanese>[LINK=IMPROVEMENT_VILLAGE]村[\LINK]を建設</Japanese>
	</TEXT>

Python OAC-アルタイル/メタトロン自動昇格

	## Altair - Upgrade Metatoron
		for iLoopPlayer in xrange(gc.getMAX_CIV_PLAYERS()):
			pLoopPlayer = gc.getPlayer(iLoopPlayer)
			if pLoopPlayer.getCivilizationType() == gc.getInfoTypeForString('CIVILIZATION_ALTAIR') and pLoopPlayer.getNumCities() > 0:
				iLoopTeam = pLoopPlayer.getTeam()
				if iLoopTeam == iTeam:

					if iTechType == gc.getInfoTypeForString('TECH_BRONZE_WORKING'):
						for pUnit in PyPlayer(iLoopPlayer).getUnitList():
							if pUnit.getUnitType() == gc.getInfoTypeForString('UNIT_METATORON1'):
								pNewUnit = pLoopPlayer.initUnit(gc.getInfoTypeForString('UNIT_METATORON2'), pUnit.getX(), pUnit.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
								pNewUnit.convert(pUnit)
					if iTechType == gc.getInfoTypeForString('TECH_MITHRIL_WORKING'):
						for pUnit in PyPlayer(iLoopPlayer).getUnitList():
							if pUnit.getUnitType() == gc.getInfoTypeForString('UNIT_METATORON2'):
								pNewUnit = pLoopPlayer.initUnit(gc.getInfoTypeForString('UNIT_METATORON3'), pUnit.getX(), pUnit.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
								pNewUnit.convert(pUnit)
								pNewUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_ELDER_DRAGON'), False)
					if iTechType == gc.getInfoTypeForString('TECH_DIVINE_ESSENCE'):
						for pUnit in PyPlayer(iLoopPlayer).getUnitList():
							if pUnit.getUnitType() == gc.getInfoTypeForString('UNIT_METATORON3'):
								pNewUnit = pLoopPlayer.initUnit(gc.getInfoTypeForString('UNIT_METATORON4'), pUnit.getX(), pUnit.getY(), UnitAITypes.NO_UNITAI, DirectionTypes.DIRECTION_SOUTH)
								pNewUnit.convert(pUnit)
								pNewUnit.setHasPromotion(gc.getInfoTypeForString('PROMOTION_GREATER_DRAGON'), False)

Python 引数の書き間違い?[DAR]

def spellConvertCityRantine(argsList):
	pCaster, pBestPlot, eSpell, liSummonedUnitIDs = argsList
	pCity = pCaster.plot().getPlotCity()
	pPlayer = gc.getPlayer(pCaster.getOwner())
	pPlayer.acquireCity(pCity, False, True)

def spellCreateBatteringRam(argsList):
	pCaster, pBestPlot, eSpell = argsList
	pPlot = pCaster.plot()
	pPlot.setFeatureType(FeatureTypes.NO_FEATURE, -1)

Python reqHireScorpionClan

def reqHireScorpionClan(argsList):
	pCaster, pPlot, eSpell = argsList
	pTeam = gc.getTeam(pCaster.getTeam())
	if pTeam.isAtWar(gc.getBARBARIAN_TEAM()):
		return ReasonTypes.REASON_DISABLED_BARBARIAN_IS_ENEMY
	return True

Python テスト

def doWindsofMiasma(argsList):
	ePlayer, eEvent, kTriggeredData = argsList
	iPlayer = kTriggeredData.ePlayer
	pPlayer = gc.getPlayer(iPlayer)
	py = PyPlayer(iPlayer)
	liPromotions = []
	if pPlayer.getStateReligion() != ReligionTypes.NO_RELIGION and gc.getReligionInfo(pPlayer.getStateReligion()).getAlignment() == gc.getInfoTypeForString('ALIGNMENT_EVIL'):
		liPromotions += [	gc.getInfoTypeForString('PROMOTION_DISEASED'),
					gc.getInfoTypeForString('PROMOTION_FEAR'),
					gc.getInfoTypeForString('PROMOTION_FIRE_RESISTANCE'),
					gc.getInfoTypeForString('PROMOTION_FLYING'),
					gc.getInfoTypeForString('PROMOTION_LIGHT'),
					gc.getInfoTypeForString('PROMOTION_MAGIC_IMMUNE'),
					gc.getInfoTypeForString('PROMOTION_MUTATED'),
					gc.getInfoTypeForString('PROMOTION_POISON_RESISTANCE'),
					gc.getInfoTypeForString('PROMOTION_PLAGUED'),
					gc.getInfoTypeForString('PROMOTION_PROPHECY_MARK'),
					gc.getInfoTypeForString('PROMOTION_STIGMATA'),
					gc.getInfoTypeForString('PROMOTION_STONESKIN'),
					gc.getInfoTypeForString('PROMOTION_UNHOLY_TAINT'),
					gc.getInfoTypeForString('PROMOTION_VILE_TOUCH'),
					gc.getInfoTypeForString('PROMOTION_VULNERABLE_TO_FIRE'),
					gc.getInfoTypeForString('PROMOTION_WINTERBORN'),
					gc.getInfoTypeForString('PROMOTION_WITHERED'),
					gc.getInfoTypeForString('PROMOTION_KAIJIN_1'),
					gc.getInfoTypeForString('PROMOTION_MAGIC_WEAKNESS'),
					gc.getInfoTypeForString('PROMOTION_GRAVITATION'),
					gc.getInfoTypeForString('PROMOTION_HOOF'),
					gc.getInfoTypeForString('PROMOTION_FOUR_EYE'),
					gc.getInfoTypeForString('PROMOTION_SLAUGHTER_IMPULSER'),
					gc.getInfoTypeForString('PROMOTION_SHELL'),
					gc.getInfoTypeForString('PROMOTION_HAND_OF_THE_POISON')	]
	elif pPlayer.getStateReligion() == gc.getInfoTypeForString('RELIGION_FELLOWSHIP_OF_LEAVES'):
		liPromotions += [	gc.getInfoTypeForString('PROMOTION_AMPHIBIOUS'),
					gc.getInfoTypeForString('PROMOTION_COLD_RESISTANCE'),
					gc.getInfoTypeForString('PROMOTION_COMMAND1'),
					gc.getInfoTypeForString('PROMOTION_DRILL1'),
					gc.getInfoTypeForString('PROMOTION_FEAR'),
					gc.getInfoTypeForString('PROMOTION_FIRE_RESISTANCE'),
					gc.getInfoTypeForString('PROMOTION_FLYING'),
					gc.getInfoTypeForString('PROMOTION_LIGHT'),
					gc.getInfoTypeForString('PROMOTION_LIGHTNING_RESISTANCE'),
					gc.getInfoTypeForString('PROMOTION_MAGIC_IMMUNE'),
					gc.getInfoTypeForString('PROMOTION_MEDIC1'),
					gc.getInfoTypeForString('PROMOTION_MUTATED'),
					gc.getInfoTypeForString('PROMOTION_NOMAD'),
					gc.getInfoTypeForString('PROMOTION_PERFECT_SIGHT'),
					gc.getInfoTypeForString('PROMOTION_POISON_RESISTANCE'),
					gc.getInfoTypeForString('PROMOTION_PROPHECY_MARK'),
					gc.getInfoTypeForString('PROMOTION_SPIRIT_GUIDE'),
					gc.getInfoTypeForString('PROMOTION_STIGMATA'),
					gc.getInfoTypeForString('PROMOTION_STONESKIN'),
					gc.getInfoTypeForString('PROMOTION_UNHOLY_TAINT'),
					gc.getInfoTypeForString('PROMOTION_VILE_TOUCH'),
					gc.getInfoTypeForString('PROMOTION_VULNERABLE_TO_FIRE'),
					gc.getInfoTypeForString('PROMOTION_WINTERBORN'),
					gc.getInfoTypeForString('PROMOTION_KAIJIN_1'),
					gc.getInfoTypeForString('PROMOTION_MAGIC_WEAKNESS'),
					gc.getInfoTypeForString('PROMOTION_MARK_OF_THE_WARDEN'),
					gc.getInfoTypeForString('PROMOTION_ADVENTURER'),
					gc.getInfoTypeForString('PROMOTION_GRAVITATION'),
					gc.getInfoTypeForString('PROMOTION_HOOF'),
					gc.getInfoTypeForString('PROMOTION_FOUR_EYE'),
					gc.getInfoTypeForString('PROMOTION_SLAUGHTER_IMPULSER'),
					gc.getInfoTypeForString('PROMOTION_SHELL'),
					gc.getInfoTypeForString('PROMOTION_HAND_OF_THE_POISON')	]
	else:
		liPromotions += [	gc.getInfoTypeForString('PROMOTION_DISEASED'),
					gc.getInfoTypeForString('PROMOTION_DRILL1'),
					gc.getInfoTypeForString('PROMOTION_LIGHT'),
					gc.getInfoTypeForString('PROMOTION_MUTATED'),
					gc.getInfoTypeForString('PROMOTION_POISON_RESISTANCE'),
					gc.getInfoTypeForString('PROMOTION_SPIRIT_GUIDE'),
					gc.getInfoTypeForString('PROMOTION_STONESKIN'),
					gc.getInfoTypeForString('PROMOTION_VULNERABLE_TO_FIRE'),
					gc.getInfoTypeForString('PROMOTION_MAGIC_WEAKNESS'),
					gc.getInfoTypeForString('PROMOTION_GRAVITATION'),
					gc.getInfoTypeForString('PROMOTION_HOOF'),
					gc.getInfoTypeForString('PROMOTION_FOUR_EYE'),
					gc.getInfoTypeForString('PROMOTION_SLAUGHTER_IMPULSER'),
					gc.getInfoTypeForString('PROMOTION_SHELL'),
					gc.getInfoTypeForString('PROMOTION_HAND_OF_THE_POISON')	]
	for pUnit in py.getUnitList():
		if pUnit.isAlive():
			if CyGame().getSorenRandNum(100, "Winds of Miasma") < 10 and len(liPromotions) > 0:
				iCount = CyGame().getSorenRandNum(2, 'the number of effects') + 1
				liChosenPromotion = []
				for iLoop in range(iCount):
					liChosenPromotion.append(liPromotions.pop( CyGame().getSorenRandNum(len(liPromotions), "Variant") ))
				liChosenPromotion.sort()
				for iChosenPromotion in liChosenPromotion:
					pUnit.setHasPromotion(iChosenPromotion, True)

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

タグ

最近投稿されたコード