Code: Select all
#for monster evolution theory, have mercy it just something that come to my mind
from random import randint
xp = 0
xpLevel = 1 #This means a multiplier of xp needed to next level
allowedMonsterXpB = True #disabled when reach full fledged version and there no more to evolve
resourceCollectionB = False #The xp are swap by collecting food
# when the bar is fuul monster will seek home or other event like nest creation on favorite place will appear (daison forrest?)
regularCrewXpB = False #for normal ship xp it can be like taken damage reduction (5% per lv), ship repairs rate, fuel efficiency, grain to detection and cloak, nothing superior
xpTarget = 0 #value for monster received from next stage of evolution hp
#like currently specimen is on lv2 whit 300hp, lv3 have 1000hp, so 1000*lv2 = targetXp 2000;
#From whit activities recieve xp
combatB = True
huntOnFavorietiesB = True
favoritePrey = "Organic Hull" #inhabited planet, Krims, ...
staingAtFavoritePlaceB = False
favoritePlace = "Asteroid Bell"
unfavoritePlace = "Black Hole" #empty system, inhabited system, ...
perTurnB = True #Age of specimen, ancient crackens disabled
staingInNebulaB = True
nebulaDecraseActionsB = False
incubatorB = True #a bulding, that create a outpost out of planet, it can be destroyed, and whit him go down the building itself
incubatorType = "Monster Crib"
asaultPlanetPopulationB = False #For harvester/ kidnappers that consume/bombard inhabited population
evolutionNeedFavoritePlaceB = True
evolutionNeedFullXpB = True
afterEvolutionRandomizeStatsB = True #as say a lite life breading,
#so the next the fleet display shall showing %of hp, maybe up down bar? green hp up 50%, range up 25%, red down 25%
rcSeekHomeB = True #resource collection - harvester
#like a bee caring pollen to its hive, so hive can get Xp and evolve to host more squadrons or spawn more powerful types
rcSetleB = False # %chance to settle down
rcTransWarpHomeB = False #Antarians harass fleet go home
rcBreadMonsterB = False #When full bread offspring if don't need a favorite place
breadTypeOfMonster = ["", ""] #Multiple version if stronger lv like bee hive
rcBreadingSelfEfectByLevelB = False #Take a drone, if factory or other level up then it can boost stats of any new drone
#obviusly the values that will show how many Xp from what shall be centralized
xpCombat = 1
xpPrey = 20
xpFavoritePlace = 1
xpNebula = 2
xpIncubator = 3
xpPlanetPopulation = 100 #like for one million and it can have like 0.1 million attack power
evolChanceBasePercentage = 20 #at full +1% for every extra %xp, or use -50 value for base, +% for gathered xp, so then 51% xp = 1% evolution chance
evolChanceFavoritePlace = 10 #ignoring when need favorite place to evolv...
evolChanceUnfavoritePlace = -50 #ignoring when need favorite place to evolv...
#turn event income of xp from position and battle
currentCance = 0
currentXpFactor = 0
canEvolB = False
diceRool = 0
def CompputeEvolutionChance():
global currentCance
global currentXpFactor
global canEvolB
global diceRool
global evolutionNeedFullXp
global evolChanceBasePercentage
placeFactor = 0
currentXpFactor = ( xp / xpTarget ) * 100
#if it need favorite position and is in that position then canEvolvB = True
#if dont need favorite position then the same
#if unfavorite position then placeFActor = evolChanceUnfavoritePlace
#if favorite then placeFactor = evolChanceFavoritePlace
if canEvolB:
if evolutionNeedFullXp:
currentCance = evolChanceBasePercentage + (currentXpFactor -100)
else:
currentCance = evolChanceBasePercentage + placeFactor + currentXpFactor
#if we thing that base is some negative number, it can be -100, so it needs the full xp to get single 1% chance
diceRool = randint(0,100)
if diceRool > currentCance:
EvolEvent()
#possibly morphing into egg, this shall be done for earlier stages of experimenter, to send eggs across galaxy whit no line warp, then few turn wait to hatch, detected egg can be collect to empire or destroyed
def EvolEvent():
#keep current hp rate
#keep ratio of max hp, att, shield, armor
#change model
#set Values based on ratio from previous
if afterEvolutionRandomizeStatsB:
PostRandomValue()
#Or breed a ofspring
#print("Evolving") #ignore this line, VSC asked for something to be here
def PostRandomValue():
#After it evolution to higher
#random modification of hp att, armor, shield +20% to -20%
# randint(-20, 20)
# but if is for rcBreadingSelfEfectByLevel then (+parent lv*10?)
print("Randomize evolution stats")