def MarnokNameGenerator(self, unit):
pPlayer = gc.getPlayer(unit.getOwner())
pCiv = pPlayer.getCivilizationType()
pReligion = pPlayer.getStateReligion()
pAlign = pPlayer.getAlignment()
lPre=["ta","go","da","bar","arc","ken","an","ad","mi","kon","kar","mar","wal","he", "ha", "re", "ar", "bal", "bel", "bo", "bri", "car","dag","dan","ma","ja","co","be","ga","qui","sa"]
lMid=["ad","z","the","and","tha","ent","ion","tio","for","tis","oft","che","gan","an","en","wen","on","d","n","g","t","ow","dal"]
lEnd=["ar","sta","na","is","el","es","ie","us","un","th", "er","on","an","re","in","ed","nd","at","en","le","man","ck","ton","nok","git","us","or","a","da","u","cha","ir"]
lEpithet=["red","blue","black","grey","white","strong","brave","old","young","great","slayer","hunter","seeker"]
lNoun=["spirit","soul","boon","born","staff","rod","shield","autumn","winter","spring","summer","wit","horn","tusk","glory","claw","tooth","head","heart", "blood","breath", "blade", "hand", "lover","bringer","maker","taker","river","stream","moon","star","face","foot","half","one","hundred","thousand"]
lSchema=["CPME","CPMESCPME","CPESCPE","CPE","CPMME","CPMDCME","CPMAME","KCPMESCUM","CPMME[ the ]CX", "CPMESCXN", "CPMME[ of ]CPMME", "CNNSCXN"]
if pAlign == gc.getInfoTypeForString('ALIGNMENT_EVIL'):
lNoun = lNoun + ["fear","terror","reign","brood","snare","war","strife","pain","hate","evil","hell","misery","murder","anger","fury","rage","spawn","sly","blood","bone","scythe","slave","bound","ooze","scum"]
lEpithet=["dark","black","white","cruel","foul"]
if pReligion == gc.getInfoTypeForString('RELIGION_THE_ASHEN_VEIL'):
lEpithet = lEpithet + ["fallen","diseased","infernal","profane","corrupt"]
lSchema = lSchema + ["CPME[ the ]CX"]
if pReligion == gc.getInfoTypeForString('RELIGION_OCTOPUS_OVERLORDS'):
lPre = lPre + ["cth","cht","shu","az","ts","dag","hy","gla","gh","rh","x","ll"]
lMid = lMid + ["ul","tha","on","ug","st","oi"]
lEnd = lEnd + ["hu","on", "ha","ua","oa","uth","oth","ath","thua", "thoa","ur","ll","og","hua"]
lEpithet = lEpithet + ["nameless","webbed","deep","watery"]
lNoun = lNoun + ["tentacle","wind","wave","sea","ocean","dark","crab","abyss","island"]
lSchema = lSchema + ["CPMME","CPDMME","CPAMAME","CPMAME","CPAMAMEDCPAMAE"]
if pReligion == gc.getInfoTypeForString('RELIGION_THE_ORDER'):
lPre = lPre + ["ph","v","j"]
lMid = lMid + ["an","al","un"]
lEnd = lEnd + ["uel","in","il"]
lEpithet = lEpithet + ["confessor","crusader", "faithful","obedient","good"]
lNoun = lNoun + ["order", "faith", "heaven","law"]
lSchema = lSchema + ["CPESCPME","CPMESCPE","CPMESCPME", "CPESCPE"]
if pReligion == gc.getInfoTypeForString('RELIGION_FELLOWSHIP_OF_LEAVES'):
lPre = lPre + ["ki","ky","yv"]
lMid = lMid + ["th","ri"]
lEnd = lEnd + ["ra","el","ain"]
lEpithet = lEpithet + ["green"]
lNoun = lNoun + ["tree","bush","wood","berry","elm","willow","oak","leaf","flower","blossom"]
lSchema = lSchema + ["CPESCN","CPMESCNN","CPMESCXN"]
if pReligion == gc.getInfoTypeForString('RELIGION_RUNES_OF_KILMORPH'):
lPre = lPre + ["bam","ar","khel","ki"]
lMid = lMid + ["th","b","en"]
lEnd = lEnd + ["ur","dain","ain","don"]
lEpithet = lEpithet + ["deep","guard","miner"]
lNoun = lNoun + ["rune","flint","slate","stone","rock","iron","copper","mithril","thane","umber"]
lSchema = lSchema + ["CPME","CPMME"]
if pReligion == gc.getInfoTypeForString('RELIGION_THE_EMPYREAN'):
lEpithet = lEpithet + ["radiant","holy"]
lNoun = lNoun + ["honor"]
if pReligion == gc.getInfoTypeForString('RELIGION_COUNCIL_OF_ESUS'):
lEpithet = lEpithet + ["hidden","dark"]
lNoun = lNoun + ["cloak","shadow","mask"]
lSchema = lSchema + ["CPME","CPMME"]
if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_ENRAGED')) == True:
# I have left this as a copy of the Barbarian, see how it goes, this might do the trick. I plan to use it when there is a chance a unit will go Barbarian anyway.
lPre = lPre + ["gru","bra","no","os","dir","ka","z"]
lMid = lMid + ["g","ck","gg","sh","b","bh","aa"]
lEnd = lEnd + ["al","e","ek","esh","ol","olg","alg"]
lNoun = lNoun + ["death", "hate", "rage", "mad","insane","berserk"]
lEpithet = lEpithet + ["smasher", "breaker", "mangle","monger"]
if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_CRAZED')) == True:
# might want to tone this down, because I plan to use it as possession/driven to madness, less than madcap zaniness.
lPre = lPre + ["mad","pim","zi","zo","fli","mum","dum","odd","slur"]
lMid = lMid + ["bl","pl","gg","ug","bl","b","zz","abb","odd"]
lEnd = lEnd + ["ad","ap","izzle","onk","ing","er","po","eep","oggle","y"]
if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_VAMPIRE')) == True:
lPre = lPre + ["dra","al","nos","vam","vla","tep","bat","bar","cor","lil","ray","zar","stra","le"]
lMid = lMid + ["cul","u","car","fer","pir","or","na","ov","sta"]
lEnd = lEnd + ["a","d","u","e","es","y","bas","vin","ith","ne","ak","ich","hd","t"]
if unit.isHasPromotion(gc.getInfoTypeForString('PROMOTION_DEMON')) == True:
lPre = lPre + ["aa","ab","adr","ah","al","de","ba","cro","da","be","eu","el","ha","ib","me","she","sth","z"]
lMid = lMid + ["rax","lia","ri","al","as","b","bh","aa","al","ze","phi","sto","phe","cc","ee"]
lEnd = lEnd + ["tor","tan","ept","lu","res","ah","mon","gon","bul","gul","lis","les","uz"]
lSchema = ["CPMMME","CPMACME", "CPKMAUAPUE", "CPMMME[ the ]CNX"]
if unit.getUnitType() == gc.getInfoTypeForString('UNIT_HILL_GIANT'):
lPre = lPre + ["gor","gra","gar","gi","gol"]
lMid = lMid + ["gan","li","ri","go"]
lEnd = lEnd + ["tus","tan","ath","tha"]
lSchema = lSchema +["CXNSCNN","CPESCNE", "CPMME[ the ]CX"]
lEpithet = lEpithet + ["large","huge","collossal","brutal","basher","smasher","crasher","crusher"]
lNoun = lNoun + ["fist","tor","hill","brute","stomp"]
if unit.getUnitType() == gc.getInfoTypeForString('UNIT_LIZARDMAN'):
lPre = lPre + ["ss","s","th","sth","hss"]
lEnd = lEnd + ["ess","iss","ath","tha"]
lEpithet = lEpithet + ["cold"]
lNoun = lNoun + ["hiss","tongue","slither","scale","tail","ruin"]
lSchema = lSchema + ["CPAECPAE","CPAKECPAU","CPAMMAE"]
if unit.getUnitType() == gc.getInfoTypeForString('UNIT_FIRE_ELEMENTAL') or unit.getUnitType() == gc.getInfoTypeForString('UNIT_AZER'):
lPre = lPre + ["ss","cra","th","sth","hss","roa"]
lMid = lMid + ["ss","ck","rr","oa","iss","tt"]
lEnd = lEnd + ["le","iss","st","r","er"]
lNoun = lNoun + ["hot", "burn","scald","roast","flame","scorch","char","sear","singe","fire","spit"]
lSchema = ["CNN","CNX","CPME","CPME[ the ]CNX","CPMME","CNNSCPME"]
if unit.getUnitType() == gc.getInfoTypeForString('UNIT_WATER_ELEMENTAL'):
lPre = lPre + ["who","spl","dr","sl","spr","sw","b"]
lMid = lMid + ["o","a","i","ub","ib"]
lEnd = lEnd + ["sh","p","ter","ble"]
lNoun = lNoun + ["wave","lap","sea","lake","water","tide","surf","spray","wet","damp","soak","gurgle","bubble"]
lSchema = ["CNN","CNX","CPME","CPME[ the ]CNX","CPMME","CNNSCPME"]
if unit.getUnitType() == gc.getInfoTypeForString('UNIT_AIR_ELEMENTAL'):
lPre = lPre + ["ff","ph","th","ff","ph","th"]
lMid = lMid + ["oo","aa","ee","ah","oh"]
lEnd = lEnd + ["ff","ph","th","ff","ph","th"]
lNoun = lNoun + ["wind","air","zephyr","breeze","gust","blast","blow"]
lSchema = ["CNN","CNX","CPME","CPME[ the ]CNX","CPMME","CNNSCPME"]
if unit.getUnitType() == gc.getInfoTypeForString('UNIT_EARTH_ELEMENTAL'):
lPre = lPre + ["gra","gro","kro","ff","ph","th"]
lMid = lMid + ["o","a","u"]
lEnd = lEnd + ["ck","g","k"]
lNoun = lNoun + ["rock","stone","boulder","slate","granite","rumble","quake"]
lSchema = ["CNN","CNX","CPME","CPME[ the ]CNX","CPMME","CNNSCPME"]
# SEA BASED
# Check for ships - special schemas
if unit.getUnitCombatType() == gc.getInfoTypeForString('UNITCOMBAT_NAVAL'):
lEnd = lEnd + ["ton","town","port"]
lNoun = lNoun + ["lady","jolly","keel","bow","stern", "mast","sail","deck","hull","reef","wave"]
lEpithet = lEpithet + ["sea", "red", "blue","grand","barnacle","gull"]
lSchema = ["[The ]CNN", "[The ]CXN", "[The ]CNX","[The ]CNSCN", "[The ]CNSCX","CPME['s ]CN","[The ]CPME", "[The ]CNX","CNX","CN['s ]CN"]
# # #
# Pick a Schema
sSchema = lSchema[CyGame().getSorenRandNum(len(lSchema), "Name Gen")-1]
sFull = ""
sKeep = ""
iUpper = 0
iKeep = 0
iSkip = 0
# Run through each character in schema to generate name
for iCount in range (0,len(sSchema)):
sAdd=""
iDone = 0
sAction = sSchema[iCount]
if iSkip == 1:
if sAction == "]":
iSkip = 0
else:
sAdd = sAction
iDone = 1
else: # MAIN SECTION
if sAction == "P": # Pre : beginnings of names
sAdd = lPre[CyGame().getSorenRandNum(len(lPre), "Name Gen")-1]
iDone = 1
if sAction == "M": # Mid : middle syllables
sAdd = lMid[CyGame().getSorenRandNum(len(lMid), "Name Gen")-1]
iDone = 1
if sAction == "E": # End : end of names
sAdd = lEnd[CyGame().getSorenRandNum(len(lEnd), "Name Gen")-1]
iDone = 1
if sAction == "X": # Epithet : epithet word part
#epithets ("e" was taken!)
sAdd = lEpithet[CyGame().getSorenRandNum(len(lEpithet), "Name Gen")-1]
iDone = 1
if sAction == "N": # Noun : noun word part
#noun
sAdd = lNoun[CyGame().getSorenRandNum(len(lNoun), "Name Gen")-1]
iDone = 1
if sAction == "S": # Space : a space character. (Introduced before [ ] was possible )
sAdd = " "
iDone = 1
if sAction == "D": # Dash : a - character. Thought to be common and useful enough to warrant inclusion : Introduced before [-] was possible
sAdd = "-"
iDone = 1
if sAction == "A": # ' : a ' character - as for -, introduced early
sAdd = "'"
iDone = 1
if sAction == "C": # Caps : capitalizes first letter of next phrase generated. No effect on non-letters.
iUpper = 1
if sAction == "K": # Keep : stores the next phrase generated for re-use with U
iKeep = 1
if sAction == "U": # Use : re-uses a stored phrase.
sAdd = sKeep
iDone = 1
if sAction == "[": # Print : anything between [] is added to the final phrase "as is". Useful for [ the ] and [ of ] among others.
iSkip = 1
# capitalizes phrase once.
if iUpper == 1 and iDone == 1:
sAdd = sAdd.capitalize()
iUpper = 0
# stores the next phrase generated.
if iKeep == 1 and iDone == 1:
sKeep = sAdd
iKeep = 0
# only adds the phrase if a new bit was actally created.
if iDone == 1:
sFull = sFull + sAdd
# trim name length
if len(sFull) > 25:
sFull = sFull[:25]
#CyInterface().addMessage(caster.getOwner(),True,25,"NAME : "+sFull,'AS2D_POSITIVE_DINK',1,'Art/Interface/Buttons/Spells/Rob Grave.dds',ColorTypes(8),pPlot.getX(),pPlot.getY(),True,True)
return sFull