Friday, December 16, 2022

Started creating in Python

I have started creating a game in Python.

This is still in progress of creation so this is not completed and this is still a demo stage. 

The following is the coding part. 

-------------------------------------------


# Imports

#Import requests for image uploading
import requests
from PIL import Image

# Import for saving data
import os
import numpy as np
import pandas as pd

# For status calculus
import calendar

# Month List
MONTH=[]
for i in range(3,13):
    MONTH.append(calendar.month_name[i])
for j in range(1,3):
    MONTH.append(calendar.month_name[j])
    
# Month List
#print(MONTH, len(MONTH))
MonthSeason=(0,0,0,1,1,1,2,2,2,3,3,3)
MonthDays=(31,30,31,30,31,31,30,31,30,31,31,28)

### --- Openning Script starts --- ###
Script01_openning="Welcome to the alternative world! You are living in a peaceful life with your wonderful daughter who is \n going to be 10 years old shortly after you are awake. \n You are obliged to bring her up until she turns to be 18 years old. \n\nYou are now living in a feudalist kingdom but its feudalist regime is actually on the verge of collapse as \n the waves of modernism are gradually approaching. A mysterious but plausible astrologist has predicted that \n this regime is estimated to end in 8 years. \n\nYour daughter seems to be dreaming to become a princess of \n this little pastoral kingdom while we expect her to live in a coming modern age and, if possible, \n to honourably lead this revolutionary movement! \n\nYou will need to send your daughter to a school to not only study for improving general characteristics \n but also train her various talents. \n But, please make sure not to bankrupt because these schools cost their tuition fee. \n Then, you will also need her to work for some part time jobs to balance the budget.  \n\nPlease also make sure to watch your daughter’s stress level which reduces her performance of increasing \n her abilities as well as her income earning. \n You will need her to take some rest and may occasionally go to vacation with her to relax. \n The positive influence of the vacation experience varies across different seasons. \n\nThis game is auto-saved while playing so that you may come back to this game with \n [1: Load to continue] from the point you ended last time unless the saved data file is lost or broken. \n\nEnjoy your life with your little princess! \n"
### --- Openning Script ends --- ###
# Default status
sts00 = "Daughters Name"
sts01=4500 # Money
sts02=0 #Stress Level
sts03=100 # Stamina
sts04=100 # Intelligence
sts05=100 # Willpower
sts06=100 # Pride
sts07=100 # Moral
sts08=100 # Elegance
sts09=100 # Amiability
sts10=100 # Art-Sense
sts11=100 # Charm
sts12=100 # Bravery
Daddy=1200 # Daddy's monthly income
YO=9 # Age at start
season=0
days=0
weeks=0
months=-1
x=0
week=0
SEASON=0
Talktime=0

# Game Starts!
print(" 0: New Game \n","1: Load to continue")
try:
    L = int(input('Enter 0 or 1'))
    if L==0:
        Load=0
        print("\n",Script01_openning)
        sts00 = input('What is the name of your little princess?')
    elif L==1:
        Load=1
        loadlist=[]
        Blk=""
        SD=(os.getcwd(),r'\PMsavedata.csv')
        SaveDirect=Blk.join(SD)
        df1=pd.read_csv(SaveDirect)
        var=0
        val=0
        for i in range(14):
            #var=df1['Variable'][i]
            val=df1['Value'][i]
            if i==0:
                loadlist.append(val)
                #print(loadlist[i],type(loadlist[i]))
                continue
            else: 
                val=float(val)
                loadlist.append(val)
                #print(loadlist[i],type(loadlist[i]))
                continue
        for i in range(14,20):
            #var=df1['Variable'][i]
            val=df1['Value'][i]
            val=int(val)
            loadlist.append(val)
            #print(loadlist[i],type(loadlist[i]))
            continue
            
        sts00=loadlist[0]
        sts01=loadlist[1]
        sts02=loadlist[2]
        sts03=loadlist[3]
        sts04=loadlist[4]
        sts05=loadlist[5]
        sts06=loadlist[6]
        sts07=loadlist[7]
        sts08=loadlist[8]
        sts09=loadlist[9]
        sts10=loadlist[10]
        sts11=loadlist[11]
        sts12=loadlist[12]
        Daddy=loadlist[13]
        YO=loadlist[14]-1
        season=loadlist[15]
        week=loadlist[16]
        days=loadlist[17]
        months=loadlist[18]
        SEASON=loadlist[19]

        #YO=YO-2
        
except ValueError:
    print('Please enter 0 or 1')

Status_Keys = ('Name', 'Age', 'Money', 'Stress', 'Stamina', 'Intelligence', 'Willpower', 'Pride', 'Moral', 'Elegance', 'Amiability', 'Art-Sense', 'Charm', 'Bravery')
Status_Values = (sts00, YO, sts01, sts02, sts03, sts04, sts05, sts06, sts07, sts08, sts09, sts10, sts11, sts12)


# Status Display
def Status():
    Status_Keys = ('Name', 'Age','Money', 'Stress', 'Stamina', 'Intelligence', 'Willpower', 'Pride', 'Moral', 'Elegance', 'Amiability', 'Art-Sense', 'Charm', 'Bravery')
    Status_Values = (sts00, YO, int(sts01), int(sts02), int(sts03), int(sts04), int(sts05), int(sts06), int(sts07), int(sts08), int(sts09), int(sts10), int(sts11), int(sts12))
    Status = dict(zip(Status_Keys,Status_Values))
    print(Status)

#Import requests for image uploading
import requests
from PIL import Image
def Character():
    if YO<12 and sts02>300:
        url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2eot0py-yg7KmNwOFWtRPRh6E2GSeb1tY2mR85IZPG-QMUYabrwmJ3fQ_4QGIINlFDMQJoOaBUmrqlJ0X_f8rN3EnszggpAHKK-vGMgVQaGZPiauUqk_zfv01pk0gxrDHWu6fXB0OxgoCBbCb3ltQbitSVlgLNndppA90M6v-tebK88IM3w/s900/PM202212171.png"
        img_data = requests.get(url, stream = True).raw
        display(Image.open(img_data))
    elif YO>11 and sts02>300:
        url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjryxUCv-9jzqm8spqwVaQ5C7onDMXOepnxeEZOxUYuXDSsHe6XKJTZXZQMzycT5txb-bEDuvyv15EY1VkkB8yKQguB4qMjeRUYdhfI9BFnZYWitO_hsOL2Ot3z_WmD5bPKyxI4-_1LjoY92qSTAXIQPFStN0GbfcxKS6kZ2r2ZyzRGW3wcdw/s900/PM202212241.png"
        img_data = requests.get(url, stream = True).raw
        display(Image.open(img_data))
    elif YO<14:
        url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeKE_EzzcxiECeILEeBUICkZkYjr2YYgzGCnQOt2vJ2habuJ7VKHznBCbuyBx_5DQTqdgOjjd8fP1db7WgX3PunFwyaWs2Ys11fJoS4oEHGIUfTpUgqcbIfzb4f_m5hbJrXkrh7fagWp_SKp4kMscgCZVuY_Kdf0b_k7_KxCoJ_vhgVkKS0Q/s900/PM202212161.png"
        img_data = requests.get(url, stream = True).raw
        display(Image.open(img_data))
    elif YO>13:
        url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhl2pfMsbpmPmILGV0AY-otFv1n0FM2n7EMc5RkkzIQBhm1Sm3zEJIm0SU2Jd22o5wgZwJYK0Tu4Xr1zwlQHcL-soMGVmN5GoWOe2d0yyEYSc6MkkbOV3GNe517_mNIpZtTXy_PwX0t1zqPId6Vpi-mq8u_BTJgDTnmp7_IYx8-fIxTNxiWoQ/s900/PM202212172.png"
        img_data = requests.get(url, stream = True).raw
        display(Image.open(img_data))

#Images for actions
def ActionImages():
    ActImg11="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2k-jggOPz61f4QM2JlqHlp4KZK8r2rydi0Mj0tQGQ7D3KzGCFCNgHl2ln19gU8oKH-ovyq2ikAOMtfcWr1yoB_tIljJqri_lyC3XHIIinkzHUf4LaeAXJr7XCwvwZ-NXZW3tXpp0LE0aC9D6YZDjGT_wqldWVcTYd9uK6OKaXLU74JICDpw/s450/PM202212301.png"
    ActImg12="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1joZu7SmASz5lwmYtCzBPOgrp6JkftDxkGLrfBD8xy0Sq7ZLtAtxvKn2hKRV8joa1QOJrkeA-zX3-Cvs3kr82vf6Ohr5vVlfPiylpZnVpEf1CcmSjPsfLHhqUcm2feY7Dljb20OvxK6j3-N5riQikrQvN63NsTePoELix6l_V_BtRSa_PaQ/s450/PM202212302.png"
    ActImg13="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWqKi4Qq0CEwEn0L1Wob7ALnaCKTlq0vKYZ_4ogRnIp9IU47dtx2EJ76Ngu0PDnjhDl5JKK75Voq9_irOhWM4FwKuHPlKsWBSbwcyCbgItEYPyS7yOz6FSRUTtWRUsJs4oPJz57tyzHiMfOPdKmXx7wWmRle4ryoMDNsqkYJFy7tFs3YHIDA/s450/PM202212303.png"
    ActImg21="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWunTyWU3P0NCjbJDRg6JTKkVd9dQpKuV5iEANvcq62jaSZEgLX5v4YS_rdRG6PrKcKtA3Iz_yLFoWXkOx5nSwb0q2URwYyzUxtw44SaVESaKz6ooGRtdWgtE95HSYmuByp4M_u4IYXpdg6eDRjqKKfahGbMQz-3m0X6-9EGcUtJIUFgXoIQ/s450/PM202212304.png"
    ActImg22="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgMBnk41JHGDJzwJvqox68PoQnsO8Xg84_nSHSQEqimWcMkwETQzVf-RjD5_rAoBnKNo5MzjveSjtBeKuFRWGoFQGtHc8aUyZNbYnxs4v54K2E8wHkND0ugUuaPgpMxgxB_VCSXqrapOY5_wo47PTvJPYE3xm8WtsIPcZBPRQ7U5723bcHqg/s450/PM202212305.png"
    ActImg23="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjrBFV_213Hq0oP4SCSqse9uLqT-735AHLUotnUPVNXp3iTicUXYrOnxbxf5x8XnnC1diCkKJjAvWDEyzJA4O-Eb03qbNO2GtWVjz3V6jY3vMlBzC42JDeQN-OumbF055Kb9m__7xPZ66tOHkr-y8601zkkhZqLZrTUKS6IjS8C7MEGmg9jAw/s450/PM202212311.png"
    ActImg24="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhks-OQH1-iWr3cNJdwRkGY_lZBDEp54DV-AVSGdWiFRBlgrzTYvEp6RIei4QHNSxz1WSVo5VWBteP84zGRAwhbWl_gRi6E27cGBX38WwYz1V1CI2j-S7d00Ytsi4WR3y2P_ovSPfP8FC_m_CzoD5NBSbBV7XgL6KzLOk9wGeBbcGyA4G4BEg/s450/PM202212312.png"
    ActImg25="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh3-PT4goNWidKthcX_ES5wEpnMSGjx_bR_c2lliAqfVKdfApchRMqwqysm8OHSUVlA53QbmRC0d3ZDYs9QbElWw5H611kMb-5qCMeRi593jgAjuU4g4D0KWOhW0tZ8fVxrCwjm_kA3ifCgpADtbdi1lIQsoaGs-WJXtmuoJEF8iMAIpJGBFA/s450/PM202212313.png"
    ActImg41="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimBCr2xASoBs0YdgUt3oNeQOSmUkWivpAwj6eEUNi8DcJ4NV1u9ON0IH_X6FtgXwiUwtVX5Uki85m-Ok_cNXC2y88teX8vfa3JZ9xH4Bn6hwuInTwC-8ZHRuHHPP5EIpNuNj4noSGfKuFsGgWTQjfsvtCP_O7VvtZ-66eYuGqGn-kD2VMEAA/s450/PM202301011.png"
    ActImg42="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAoixiBmj3OQBrs9CaK3C4eBD-m-ZnK9k7aM2VBsH0WLo1ELdep42zA9rj5Ie8abmDRSOO-BpXDRlq45GtvoAMV1O2GkpxIkskyDK0hI4dO0PsCUdrWnTPOEJp2pzYV74ZLFUbXUVHWLA7gSNSfvUztbAZsTBvXTwW6VKSFshvniieqlc6Nw/s450/PM202301012.png"
    VactionImages430="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifSxUI41JmWtMvCAo1Mo2_w3Lv5MTUY6XGKt4SHKeoL5SH_KgjBrBzHXnfCeFUZcdcEjYuSxySqNOvelBjtlGbJSjb55LydWx3cWzZFNWFsVGd20hQOXwvH695R3G3u_qDurV3vOwygGCYBnI203klQNcV28hyvVTSK0deerqDnQSoVdy3lA/s600/PM202212281.png"
    VactionImages431="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh01fS93rWL0FiN-3ALQ6vRmy2ihqrlJwV5KQZ0g6mLIk4UNv5rANuHcFM5-zZXCWJecF-oSL7id3ixYf9Ho1U57gRyIXr7MkEqy5TaJOyn1sYaCb-NXd-MnvpKCCjjDGFUqFtzwoXWNIC7HPkp0EHk8xQiRjhhA9mwDH3NxNpFEGKtNS6LSQ/s600/PM202212291.png"
    VactionImages432="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwPCdyRFRriRSf11HeTDgKnR_tuEazqLQYkgSx30rx5XJDVxMaBaUiRVfwbLSsbbzX5lHuCCrr3_oitxT2eCXe553kbHZrYE6Q_gOuaR5toTDGKG7Qx0wQhWB8LXp8fvjQcyDOhdAJ32H8lxHfS-fmTK_SD08-gwH04pda3oiuaIWWTZV4UA/s600/PM202212282.png"
    VactionImages433="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNvx2i-n55sjAhY2FmJebX61zqBrHjJKrQLfDuj78QgQV0I9G0NXbSjG50AQTISugtfTQFqhStVCU5hsPcwjZisr7Ds0Oj6UEqlyWDDNBCdq7NgvMgQ1GSOwaRw6hZ4s2wQEtlyJjfp82-fhkeV9i6MGFtqMIWQIpooGJnGXiOlhCsmAUyyg/s600/PM202212283.png"
    VactionImages=[VactionImages430,VactionImages431,VactionImages432,VactionImages433]
    ActImg43=VactionImages[season]
    ActImgList=[0,0,0,0,0,0,0,0,0,0,0,
           ActImg11,ActImg12,ActImg13,0,0,0,0,0,0,0,
           ActImg21,ActImg22,ActImg23,ActImg24,ActImg25,0,0,0,0,0,
           0,0,0,0,0,0,0,0,0,0,
           ActImg41,ActImg42,ActImg43]
    ActImgList[x]
    
    url = ActImgList[x]
    img_data = requests.get(url, stream = True).raw
    display(Image.open(img_data))
        
        

# Tuple List Schools
sc01a=("School",0,0,3,6,5,6,12,9,3,5,0,0,"is studying at")
sc01d=("School",100.0,-5,0,0,0,0,0,0,0,0,0,0,"is studying at")
sc01p=("School",0,0,1,2,1,1,2,1,1,2,0,0,"is studying at")

sc02a=("Barrack",0,0,9,2,6,4,0,0,0,0,0,12,"is training at")
sc02d=("Barrack",50.0,-9,0,0,0,0,0,3,0,0,0,0,0,"is training at")
sc02p=("Barrack",0,0,3,1,2,0,0,0,0,0,0,4,0,"is training at")

sc03a=("Ballet",0,0,9,2,9,12,0,18,0,9,9,0,"is practising at")
sc03d=("Ballet",150.0,-6,0,0,0,0,0,0,0,0,0,0,0,"is practising at")
sc03p=("Ballet",0,0,1,1,1,1,0,2,0,2,2,0,0,"is practising at")

# Tuple List Jobs
jb01a=("Retail",100.0,0,2,3,5,0,0,0,0,0,8,0, "is wisely working at")
jb01d=("Retail",0,-10,0,0,0,1,2,2,4,0,0,0, "is wisely working at")
jb01p=("Retail",0,0,2,2,5,0,0,0,0,0,1,0, "is wisely working at")

jb02a=("Bar-Maid",150.0,0,3,0,3,0,0,0,0,0,9,0, "is charmingly working at")
jb02d=("Bar-Maid",0,-12,0,0,0,2,4,3,4,0,0,0, "is charmingly working at")
jb02p=("Bar-Maid",0,0,2,0,1,0,0,0,2,0,5,0, "is charmingly working at")

jb03a=("Bar-Bouncer",200.0,0,4,0,4,0,0,0,0,0,0,8, "keeps customers in fear of her at")
jb03d=("Bar-Bouncer",0,-12,0,0,0,0,5,5,5,1,4,0, "keeps customers in fear of her at")
jb03p=("Bar-Bouncer",0,0,2,0,1,0,0,0,0,0,0,7, "keeps customers in fear of her at")

jb04a=("Border-Patrol",90.0,0,4,0,6,4,6,0,0,0,0,6, "is on duty at")
jb04d=("Border-Patrol",0,-7,0,0,0,0,0,3,1,1,4,0, "is on duty at")
jb04p=("Border-Patrol",0,0,1,0,1,2,2,0,0,0,0,4, "is on duty at")

jb05a=("Babysitting",60.0,0,7,0,7,0,9,0,15,0,0,0, "is looking after infants and small-kids with her motherhood emotion at")
jb05d=("Babysitting",0,-10,0,0,0,2,0,3,0,0,0,0, "is looking after infants and small-kids with her motherhood emotion at")
jb05p=("Babysitting",0,0,2,0,2,0,2,0,4,0,0,0,0, "is looking after infants and small-kids with her motherhood emotion at")



# Tuple List Rest and Vacation


Vacation=['pops up to a beautiful meadow with a full of blooming flowers during her lively Spring',
         'enjoys sea-bathing at a tropical resourt beach beside during her exciting unforgettable Summer',
         'calms herself down under these tinting trees of a nostalgic country side during her melancholic Autumn',
         'is lost in tought for a chilling weather under a calm dark snowy sky during her Winter']
vacation=Vacation[season]

# Vacation Status Bonus 
VCT0=(0,0,0,2,2,2) # Spring Vacation Bonus
VCT1=(0,0,0,0,0,6) # Summer Vacation Bonus
VCT2=(0,0,3,0,3,0) # Autunn Vacation Bonus
VCT3=(1,1,1,1,1,1) # Winter Vacation Bonus
VCTsts=[sts03,sts05,sts08,sts09,sts10,sts11]
VCTcng=(VCT0,VCT1,VCT2,VCT3)
ifVCT=(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1)


# Rest at home
rst01a=("Home",0,0,0,0,0,0,0,0,9,0,0,0,"is just relaxing at")
rst01d=("Home",3.0,20,2,0,3,0,0,0,0,0,0,0,"is just relaxing at")
rst01p=("Home",0,0,0,0,0,0,0,0,0,0,0,0,"is just relaxing at")

# Going out
rst02a=("Going-Out",0,0,0,0,0,0,0,0,0,3,3,0,"has a little fun while")
rst02d=("Going-Out",20.0,30,0,0,3,0,3,0,2,0,0,0,0,"has a little fun while")
rst02p=("Going-Out",0,0,0,0,0,0,0,0,0,0,0,0,0,"has a little fun while")

# Go vacation
rst03a=("Vacation",0,0,0,0,0,0,0,0,0,0,0,0,"is on")
rst03d=("Vacation",300.0,70,0,0,0,0,0,0,0,0,0,0,0,vacation)
rst03p=("Vacation",0,0,0,0,0,0,0,0,0,0,0,0,0,vacation)



# Displaying her action for days in a week
def Action():
    Vacation=['pops up to a beautiful meadow with a full of blooming flowers during her lively Spring',
         'enjoys sea-bathing at a tropical resourt beach beside during her exciting unforgettable Summer',
         'calms herself down under these tinting trees of a nostalgic country side during her melancholic Autumn',
         'is lost in tought for a chilling weather under a calm dark snowy sky during her Winter']
    vacation=Vacation[season]
    Seasons1=['Spring','Summer','Autumn','Winter']
    Seasons2=['joyful','hot','calming','cold']
    print(sts00, schd_a[13], schd_a[0],"during the",Seasons2[season], "season of the", Seasons1[season], "time.")
    

### --- Ending Script starts --- ###
Script02_EndingForAll="This nostalgic but backward kingdom has faced its catastrophic ending with the newly emerging power of the republic overthrowing the monarchism under the slogans,’ Liberty, Equality, and Fraternity’ and ‘Of the people, By the people, For the people’. \n\nThe pastoral kingdom was peaceful and proud of its cultural heritage. However, the static lifestyle, the stagnated growth of living standard, and the unfair prestige of the monarchy and his peer aristocratic nobles caused the frustration of the fellow majority commoners. In particular, both enlightened intellectual and rebellious courageous individuals most notably led the revolution replacing the old regime with their new alternative. \n\n… tragic, …… how tragic of some believing in an everlasting dream of something having been seen as invincible! The dream of various…… Yes, dreams strongly remain in our mind but are indeed transient as same as the dream of the long-live regime of this little kingdom! … the great dream of one little girl is also the dream too.  \n\nMeanwhile, there was a rumour that a glorious passionate young lady leading the fellow people under this revolutionary conflict but who knows this goddess-like young lady was…  \n\n"
Script03_Ending_BeingLost="Many people welcomed this revolutionary movement altering the old regime whereas there were also those who have suffered. They were not only those having taken advantage of the old regime but also those who could not find the way of their life in the new era and those who were injured during this turmoil. You sustained a wound from the last turmoil as you have lost the means of living mentally and physically.", sts00, "seems to have disappeared from you while you could not show her the pathway to live in this world. Your negligence caused both her and yourself severe existential crisis. You may just hope she is living fine somewhere you will never know while suffering from your own existential threat too. "
Script04_Ending_Revolutionary="‘Rejoice …. Our glorious day has arrived!’ The lady ardently conducting the people for the revolution was actually", sts00,"!  Liberty is herself and she herself is liberty leading the people! She is grown up intelligently as well as courageously enough to understand such abstract concepts enabling individuals to imagine their alternative world view much more deserving themselves than the conventional world structure. Her charm also backed up her revolutionary charisma cheering the fellows up! Long live Mo.",sts00,"! Long live revolution!"
Script05_Ending_NobleLady="Your little princess, sts00, had a dream of becoming a real princess. But, becoming a real princess is no longer accomplishable because the monarchy is abolished. Yet, she is still your little princess for sure.  There is another gentleman who think as same as how you think of your sweet", sts00,"as. He is a rich successful man who is actually an enlightened noble but opposed to the last king and his regime. Under this post-revolution republic, he succeeded to stay in a power as a notable gentry successful in his business entrepreneur as well as being influential in the parliament. He proposed your daughter", sts00,"with a full of his passion and she happily accepted. She seems to actually live in a life of princess although this is not quite exactly the same."
Script06_Ending_UnderworldBoss="There is a proverb saying the enemy of your enemy is your friend. In this revolutionary civil war, this proverb also prevailed. Your daughter", sts00,"was leading the underworld faction of the revolution undermining the status-quo of the old regime. She could not be adapted to the mainstream community of her childhood. Instead, she was gradually adapted to the underworld, and then gradually distinguished herself with her strength and charisma. Even in the post-revolution republic, she still actively participated the underworld activities which cannot explicitly publicised. Nevertheless, her leadership as the organised faction was demanded in order to sustain order and stability of that world. Head and tail as well as light and shadow are inseparable to each other so that the latter world require the function too. "
Script07_Ending_RetailProfessional="Merchandise tends to thrive in any political system because it is simply required to sustain people’s daily life as well as enriching these powerful ones. Regardless of kingdom or republic, these wise merchants thrive to prop up their business. Your daughter", sts00,"works for the retail of her familiar business with her experience as well as her intelligence learnt through schooling and work experience in retail. She decided to pursue what she was already familiar with, and then she eventually became this professional.  "
Script08_Ending_HouseWife="While", sts00,"was turning to be an adulthood from a childhood, her country was in such a turmoil of the political transition from a kingdom to a republic. It is unimaginable to think how many times she wished for peace and stability in her new life. Someone may pick on her choice as mediocre, but we often forget how the ordinary life is precious. Protecting and developing a household is often challenging as much as doing for a country. Now,", sts00,"is a proud house-wise looking after her family members as well as her house itself."
Script09_Ending_Charming_Tavern_Master="Human-beings are naturally social so that their social interaction always thrives to exist regardless of kingdom or republic, or even on a verge of national crisis. Charming",sts00,"attracts many people to come to gather in her tavern. Her customers were cheered up her hospitable personality as well as her attractive appearance. Even after the revolution, the face of customers did not change much in such a public place in a downtown. Regardless of monarchism or republicanism, the majority people are just busy with their daily life which hardly changes despite the political transition. The lady",sts00,"contributed to the greatest sum of pleasures for the people having survived from the previously existing kingdom to the newly established republic.  "
### --- Ending Script ends --- ###

# Ending
def Ending():
    Ending=""
    EndRoll=""
    print(Script02_EndingForAll)
    if sts04>700 and sts06>600 and sts07>600 and sts11>500 and sts12>599:
        Ending="Revolutionary, the liberty leading the people"
        url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiNZrMqlUp0GLjCgoKQXtxPTj_Flm6BVW2hioCMdhEKMtlz5uHJ2qRQBZnFFoac6ngJjZZVQ8dTtoQ1LOLl9xv6XjZBQUzw0LL72EE3SIMR0o_FQ5EmSduWWeOlICz7t7Eq5TzyluAhuECdvlNYTKFmeTdnEJ6Nv73jnvm9ipdL8sr_LTfA_A/s900/PM202212181.png"
        img_data = requests.get(url, stream = True).raw
        display(Image.open(img_data))
        EndRoll=Script04_Ending_Revolutionary
    elif sts04>600 and sts06>500 and sts07>400 and sts08>590 and sts09>490 and sts10>790 and sts11>900:
        Ending="Noble-Lady"
        url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHEWu6FMCT0oJnxrRB0D7flkSAQ4lnQKQBLYJ4CpObBhm6qtUnF-aPB6U-bi8B4jvEYFXMuMv1BvHt63qEyqfCF5BNVmiep1Ds2LDWTSRuH1K98eMqxjmHgweUMwxtHnujK_FVZuckQYHuMpyFc5HQix68CSWRYeCRR8JYCuVhazhE82ix6A/s900/PM202212251.png"
        img_data = requests.get(url, stream = True).raw
        display(Image.open(img_data))
        EndRoll=Script05_Ending_NobleLady
    elif sts04>500 and sts07<600 and sts12>700:
        Ending="Underworld-Boss"
        url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjgoPdpzYABTSwzc-O-3TPv6SzvZpgu20c24feIQ2zXJfK5ojWUOPRW_U6K1lpUtRbCjM7CBFB-JRQWcVV-tiszeyTaryx9Zh5zXUziGNiif0UO4qKGsTXyRDUppUdvqlCNqmyYgloOWA2UOGfmJyWI1szxjRXHZJBJKtB9vYKQSDdYu3_mA/s900/PM202212232.png"
        img_data = requests.get(url, stream = True).raw
        display(Image.open(img_data))
        EndRoll=Script06_Ending_UnderworldBoss
    elif sts07>490 and sts09>490:
        Ending="House-Wife"
        url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVApIennZ6xXfxMB32BMK_9kl1_qS0bNU_rWlAFzjfLu1V82OF4cbo6ZSLGaKEUosb2eHzxvN4dtqjDu49SlMbXwlljL2risGVQCdf9yQF4CWdv3Ucq_brjvMuLJPJPYrmumJBxcS7EhDLHs44bt6hOP4aR87nnHlLD5EW-_qaTFic7vlokg/s900/PM202212231.png"
        img_data = requests.get(url, stream = True).raw
        display(Image.open(img_data))
        EndRoll=Script08_Ending_HouseWife
    elif sts04>690:
        Ending="Retail-Professional"
        url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWunTyWU3P0NCjbJDRg6JTKkVd9dQpKuV5iEANvcq62jaSZEgLX5v4YS_rdRG6PrKcKtA3Iz_yLFoWXkOx5nSwb0q2URwYyzUxtw44SaVESaKz6ooGRtdWgtE95HSYmuByp4M_u4IYXpdg6eDRjqKKfahGbMQz-3m0X6-9EGcUtJIUFgXoIQ/s450/PM202212304.png"
        img_data = requests.get(url, stream = True).raw
        display(Image.open(img_data))
        EndRoll=Script07_Ending_RetailProfessional
    elif sts11>700:
        Ending="Charming-Tavern-Master"
        url = "https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhgMBnk41JHGDJzwJvqox68PoQnsO8Xg84_nSHSQEqimWcMkwETQzVf-RjD5_rAoBnKNo5MzjveSjtBeKuFRWGoFQGtHc8aUyZNbYnxs4v54K2E8wHkND0ugUuaPgpMxgxB_VCSXqrapOY5_wo47PTvJPYE3xm8WtsIPcZBPRQ7U5723bcHqg/s450/PM202212305.png"
        img_data = requests.get(url, stream = True).raw
        display(Image.open(img_data))  
        EndRoll=Script09_Ending_Charming_Tavern_Master
    else:
        Ending="Lost while revolution..."
        EndRoll=Script03_Ending_BeingLost
    print("Through this revolutionary turmoil", sts00, "has become", Ending,"! \n")
    print(EndRoll)
     
        

### ------  Menu Frame ------ ###
Schedule_Selection_a=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      sc01a, sc02a, sc03a, 0, 0, 0, 0, 0, 0, 0,
                      jb01a, jb02a, jb03a, jb04a, jb05a, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      rst01a, rst02a, rst03a, 0, 0, 0, 0, 0, 0, 0
                     )
Schedule_Selection_d=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      sc01d, sc02d, sc03d, 0, 0, 0, 0, 0, 0, 0,
                      jb01d, jb02d, jb03d, jb04d, jb05d, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      rst01d, rst02d, rst03d, 0, 0, 0, 0, 0, 0, 0
                     )
Schedule_Selection_p=(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      sc01p, sc02p, sc03p, 0, 0, 0, 0, 0, 0, 0,
                      jb01p, jb02p, jb03p, jb04p, jb05p, 0, 0, 0, 0, 0,
                      0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
                      rst01p, rst02p, rst03p, 0, 0, 0, 0, 0, 0, 0
                     )
Menu_Input=[]
Menu_Action=[]
Menu_Daily_Fee=[]
Menu_Daily_Rate=[]
Requirement=[]
Menu_Reqs=[]
for i in range(51):
    if Schedule_Selection_a[i]==0:
        continue
    else:
        for j in range(2,13):
            if Schedule_Selection_p[i][j]<2:
                continue
            else:
                Requirement.append(Status_Keys[j+1])
            
        #print(Schedule_Selection_a[i][0], Schedule_Selection_d[i][1],Schedule_Selection_a[i][1],Requirement)
    Menu_Input.append(i)
    Menu_Action.append(Schedule_Selection_a[i][0])
    Menu_Daily_Fee.append(Schedule_Selection_d[i][1])
    Menu_Daily_Rate.append(Schedule_Selection_a[i][1])
    Menu_Reqs.append(Requirement)
    Requirement=[]
#print(Menu_Input,"\n",Menu_Action,"\n",Menu_Daily_Fee,"\n",Menu_Daily_Rate,"\n",Menu_Reqs)
Menu_dict={'Key Input':Menu_Input,'Action':Menu_Action,'Fee':Menu_Daily_Fee,'Wage':Menu_Daily_Rate,'Requirements':Menu_Reqs,}
Menu = pd.DataFrame(Menu_dict)
Menu
### ------ End of Menu Frame ------ ###


x=0

Status_Keys = ('Name', 'Money', 'Stress', 'Stamina', 'Intelligence', 'Willpower', 'Pride', 'Moral', 'Elegance', 'Amiability', 'Art-Sense', 'Charm', 'Bravery')
Status_Values = (sts00, sts01, sts02, sts03, sts04, sts05, sts06, sts07, sts08, sts09, sts10, sts11, sts12)


# Mainframe without making it the function
xlist=[1,2,11,12,13,21,22,23,24,25,41,42,43,99]
Seasons1=['Spring','Summer','Autumn','Winter']
Seasons2=['joyful','hot','calming','cold']

for year in range(8):  
    YO=YO+1
    print('-+--+--+--+--+--+--+--+--+--+--+--+--+-- \n')
    print("Happy",YO, "birthday my dear", sts00,"! \n")
    print('-+--+--+--+--+--+--+--+--+--+--+--+--+--')
    if x==99 or sts01<0:
        print("Game ends.")
        break
    elif YO>17:
        Ending()
        break
    else:             
        for month in range(12): 
            if Load==1 and months!=month:
                #print("month:", month, "Month:", MONTH[months], months)
                continue
            else:
                Load=0
                #months=months+1
                #print("season:",season, "SEASON:",SEASON, "Month:", MONTH[months], months)
            
                months=month
                season=MonthSeason[month]
                if x==99 or sts01<0 or months>11:
                    break
                elif YO>17:
                    break
                #months=months+1  
                print("New month", MONTH[months], "starts!")
                
                # Auto-Save
                savelist_variable=['sts00','sts01','sts02','sts03','sts04','sts05','sts06','sts07','sts08','sts09','sts10','sts11','sts12','Daddy','YO','season','week','days','months','SEASON']                    
                savelist_value=[sts00,sts01,sts02,sts03,sts04,sts05,sts06,sts07,sts08,sts09,sts10,sts11,sts12,Daddy,YO,season,week,days,months,SEASON]
                Save_dict={'Variable':savelist_variable,'Value':savelist_value}
                df = pd.DataFrame(Save_dict)
                Blk=""
                SD=(os.getcwd(),r'\PMsavedata.csv')
                SaveDirect=Blk.join(SD)
                os.makedirs(os.getcwd(), exist_ok=True)  
                df.to_csv(SaveDirect)   
                print("Data Sevad!")
                    
                for week in range(4):
                    Character()
                    weeks=weeks+1
                    print("New", weeks,"th week starts!")
                    if x==99:
                        break
                    elif sts01<0:
                        print("You are bankrupt! Game over!")
                        break
                    elif sts02<0:
                            sts02=0
                            weeks=weeks-1
                            continue

                    # Command Input
                    print("  1: Show Status \n", " 2: Talk to",sts00,"(If NLTK is downloaed!) \n","99: Game End")
                    display(Menu) # Call Panda-Dataframe Menu
                    try:
                        x = int(input('What is this week schedule for?'))
                        #print(x, type(x))
                        if x == 99 or YO>17:
                            break
                        elif x==194:
                            YO=YO+1
                            continue
                        elif x==1:
                            Status()
                            weeks=weeks-1
                            continue

                        elif x==2:
                        # Only available to activate if you have installed NLTK!
                            import nltk
                            from nltk.sentiment.vader import SentimentIntensityAnalyzer
                            analyser = SentimentIntensityAnalyzer()
                            import math
                            while Talktime==0:
                                Talk=input('What you would like to say?')
                                print('-+--+--+--+--+--+--+--+--+--+--+--+--+--')
                                tlknd_sentences=nltk.sent_tokenize(Talk)
                                tlknd_words=nltk.word_tokenize(Talk)
                                
                                sentences_neg_count=0
                                sentences_neu_count=0
                                sentences_pos_count=0
                                sentences_neg_score=0
                                sentences_pos_score=0
                                sentences_score=0
                                for i in range(len(tlknd_sentences)):
                                    score_sentences = analyser.polarity_scores(tlknd_sentences[i])
                                    sentences_neu_count+=[analyser.polarity_scores(tlknd_sentences[i])['neu']][0]
                                    sentences_neg_count+=[analyser.polarity_scores(tlknd_sentences[i])['neg']][0]
                                    sentences_neg_score+=[analyser.polarity_scores(tlknd_sentences[i])['neg']][0]*[analyser.polarity_scores(tlknd_sentences[i])['compound']][0]
                                    sentences_pos_count+=[analyser.polarity_scores(tlknd_sentences[i])['pos']][0]
                                    sentences_pos_score+=[analyser.polarity_scores(tlknd_sentences[i])['pos']][0]*[analyser.polarity_scores(tlknd_sentences[i])['compound']][0]
                                    #display(tlknd_sentences[i], analyser.polarity_scores(tlknd_sentences[i]))
                                if sentences_neu_count<sentences_neg_count or sentences_neu_count<sentences_pos_count:
                                    sentences_score=0
                                elif sentences_pos_count>sentences_neg_count:
                                    sentences_score=sentences_pos_score
                                elif sentences_pos_count<sentences_neg_count:
                                    sentences_score=sentences_neg_score    
                                else: 
                                    sentences_score=0
                                #print(sentences_score, "  #Neg:",sentences_neg_count,"  #Neu",sentences_neu_count,"  #Pos",sentences_pos_count,)
                                words_neg_count=0
                                words_neu_count=0
                                words_pos_count=0
                                words_neg_score=0
                                words_pos_score=0
                                words_score=0
                                for i in range(len(tlknd_words)):
                                    score_words = analyser.polarity_scores(tlknd_words[i])
                                    words_neu_count+=[analyser.polarity_scores(tlknd_words[i])['neu']][0]
                                    words_neg_count+=[analyser.polarity_scores(tlknd_words[i])['neg']][0]
                                    words_neg_score+=[analyser.polarity_scores(tlknd_words[i])['neg']][0]*[analyser.polarity_scores(tlknd_words[i])['compound']][0]
                                    words_pos_count+=[analyser.polarity_scores(tlknd_words[i])['pos']][0]
                                    words_pos_score+=[analyser.polarity_scores(tlknd_words[i])['pos']][0]*[analyser.polarity_scores(tlknd_words[i])['compound']][0]
                                    #display(tlknd_words[i], analyser.polarity_scores(tlknd_words[i]))
                                if words_neu_count<words_neg_count or words_neu_count<words_pos_count:
                                    words_score=0
                                elif words_pos_count>words_neg_count:
                                    words_score=words_pos_score
                                elif words_pos_count<words_neg_count:
                                    words_score=words_neg_score    
                                else: 
                                    words_score=0
                                #print(words_score, "  #Neg:",words_neg_count,"  #Neu",words_neu_count,"  #Pos",words_pos_count,)
                                TotExp=(math.exp(sentences_score)*0.6)*((math.exp(words_score)*2))
                                TotalScore=math.log(TotExp)
                                print("Your Sentiment Score:",int(TotalScore))
                                print('-+--+--+--+--+--+--+--+--+--+--+--+--+--')
                                Talktime+=1
                                if TotalScore>3:
                                    print(" \n\n",sts00,'says "....Wow daddy, thanks! I am so touched. xxx"\n\n')
                                    print('-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--')
                                    sts02=sts02-90 #Stress Level
                                    sts05=sts05+10 # Willpower
                                    sts06=sts06+60 # Pride
                                    sts07=sts07+20 # Moral
                                    sts08=sts08+20 # Elegance
                                    sts09=sts09+20 # Amiability
                                    Status()
                                elif TotalScore>1: 
                                    print(" \n\n",sts00,'says "Thank you, daddy. x "\n\n')
                                    print('-+--+--+--+--+--+--+--+--+--+--+--+--+--')
                                    sts02=sts02-60 #Stress Level
                                    sts09=sts09+10 # Amiability
                                    Status()
                                elif TotalScore<-2:
                                    print(" \n\n",sts00,'says ".... I am so sorry. Please forgive me, daddy..."\n\n')
                                    print('-+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--')
                                    sts02=sts02+60 #Stress Level
                                    sts06=sts06-30 # Pride
                                    sts07=sts07+120 # Moral
                                    sts08=sts08+120 # Elegance
                                    Status()
                                elif TotalScore<0:
                                    print(" \n\n",sts00,'says "Go away."\n\n')
                                    print('-+--+--+--+--+--+--+--+--')
                                    sts02=sts02+60 #Stress Level
                                    sts06=sts06-30 # Pride
                                    Status()
                                else:
                                    print(" \n\n",sts00,'says "Oh ok."\n\n')
                            print('-+--+--+--+--+--+--+--+--+--+--+--+--')
                            print(sts00,'says "have a nice day, daddy!"')
                            print('-+--+--+--+--+--+--+--+--+--+--+--+--')
                        # Above: Only available to activate if you have installed NLTK!
                            weeks=weeks-1
                            continue

                        elif x in xlist:           
                            for day in range(1,8):

                                schd_a = Schedule_Selection_a[x]
                                schd_d = Schedule_Selection_d[x]
                                schd_p = Schedule_Selection_p[x]
                                
                                # Growth Influencing Plus Metre before daily growth
                                PLS=0
                                pls=0
                                #sts_list
                                sts_list=[sts00,sts01,sts02,sts03,sts04,sts05,sts06,sts07,sts08,sts09,sts10,sts11,sts12]
                                for p in range(3,13):
                                    #print(Status_Keys[p],Schedule_Selection_p[x][p],sts_list[p]/100) # Delete in the mainframe
                                    PLS=PLS+Schedule_Selection_p[x][p]*sts_list[p]/100
                                    #print(PLS)
                                    pls=pow(PLS/10,0.5) ####
                                #print("pls:", pls/100)
                                
                                
                                # Daily Status Growth
                                sts01= sts01+ pow(schd_a[1],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[1]
                                sts02= sts02+ pow(schd_a[2],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[2]
                                sts03= sts03+ 0.5*pow(schd_a[3],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[3]
                                sts04= sts04+ 0.5*pow(schd_a[4],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[4]
                                sts05= sts05+ 0.5*pow(schd_a[5],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[5]
                                sts06= sts06+ 0.5*pow(schd_a[6],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[6]
                                sts07= sts07+ 0.5*pow(schd_a[7],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[7]
                                sts08= sts08+ 0.5*pow(schd_a[8],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[8]
                                sts09= sts09+ 0.5*pow(schd_a[9],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[9]
                                sts10= sts10+ 0.5*pow(schd_a[10],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[10]
                                sts11= sts11+ 0.5*pow(schd_a[11],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[11]
                                sts12= sts12+ 0.5*pow(schd_a[12],1+pls/100)*((pow(2,1-sts02/100))/2) -schd_d[12]
                                Action()
                                ### --- Vacation only effect starts --- ###
                                Vacation=('She pops up to a beautiful meadow with a full of blooming flowers during her lively Spring',
                                          'She enjoys sea-bathing at a tropical resourt beach beside during her exciting unforgettable Summer',
                                          'She calms herself down under these tinting trees of a nostalgic country side during her melancholic Autumn',
                                          'She is lost in tought for a chilling weather under a calm dark snowy sky during her Winter')
                                vacation=Vacation[season]
                                VacationMessage=('','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',
                                                 '','',vacation)
                                print(VacationMessage[x])
                                VCTsts=[sts03,sts05,sts08,sts09,sts10,sts11]
                                for i in range(len(VCTsts)):
                                    VCTsts[i]=VCTsts[i]+VCTcng[season][i]*ifVCT[x]*((pow(2,1-sts02/100))/2)
                                    #print(VCTsts)
                                    sts03=VCTsts[0]
                                    sts05=VCTsts[1]
                                    sts08=VCTsts[2]
                                    sts09=VCTsts[3]
                                    sts10=VCTsts[4]
                                    sts11=VCTsts[5]
                                ### --- Vacation only effect ends --- ###
                                ActionImages()
                                Status()
                                days=days+1
                                Talktime=0
                                print("The end of day",day, "in the week",weeks,",",
                                        days, "th day of", MONTH[months],
                                        "in the season of", Seasons1[season], ". \n")
                                if days>=MonthDays[months]:
                                    if months==11:
                                        months=0
                                        print("The end of month. Today is daddy's (your) payday!")
                                        sts01=sts01+Daddy
                                        Status()
                                        days=0
                                        weeks=0
                                        break
                                    else:
                                        months=months+1
                                        print("The end of month. Today is daddy's (your) payday!")
                                        sts01=sts01+Daddy
                                        Status()
                                        days=0
                                        weeks=0
                                        break
                                elif YO>17:
                                    break
                                else:
                                    continue
                                continue
                        else:
                            print("Not in the schedule menu! Please try again.")
                            continue
                    except ValueError:
                        print('Please enter an integer.')


------------------------------------------- 

The end of coding part.

The following images are the very first character design.  


 



 











 
 


 


 
 

 



















PS

How to play "Liberty's Daughter 育成ゲーム" with Colaboratory


No comments: