Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- title Village Manager
- :header
- cls
- echo ------------------------
- echo Head of the Village
- echo ------------------------
- echo 1- Start Game
- echo 2- Exit
- echo ------------------------
- choice /c 12 /n >nul
- if %errorlevel% == 1 (
- call :data
- set /p name=Enter name of Village:
- goto game
- )
- if %errorlevel% == 2 exit
- goto header
- :data
- set name=Nameless Village
- set gold=100
- set pop=0
- set villagers=5
- set militia=5
- set livestock=0
- set grain=0
- set grainSkill=0
- set grainLoss=0
- set deathTollVillagers=0
- set deathTollMilitia=0
- set tax=1
- set resourceActs=0
- set fleeChances=0
- set fleeChance=15
- set raids=0
- set raidChance=0
- set raidType=0
- set raidToggle=0
- set daysUntilRaid=0
- set days=0
- set years=0
- set time=0
- set timeRate=9999
- set state=Start
- goto:eof
- :status
- set /a pop=%militia%+%villagers%
- if %pop% LEQ 0 (
- goto gameover
- )
- if %resourceActs% EQU 0 set acting=No Actions being Taken, Have the Village do something in Managment!
- if %resourceActs% EQU 1 set acting=The Villagers are Growing Grain
- if %resourceActs% EQU 2 set acting=The Villagers are Raising Livestock
- if %resourceActs% EQU 3 set acting=The Villagers are Expanding Population
- if %days% GEQ 365 (
- set days=0
- set /a years+=1
- )
- goto:eof
- :gameover
- cls
- echo ------------------------------------------------------------------------
- echo Pity, your village is now desolate! Everyone is dead and rotting.
- echo ------------------------------------------------------------------------
- echo You lasted %years% Years and %days% Days, surviving %raids% Raids on your village.
- echo ------------------------------------------------------------------------
- echo Press any Key to Return to Menu...
- pause>nul
- goto header
- :game
- call :status
- cls
- echo -----------------------------------------
- echo Village Name: %name% /\ Gold: %gold% /\ Population: %pop%
- echo -
- echo Villagers: %villagers%
- echo Militia: %militia%
- echo -----------------------------------------
- echo Time Since Establishment: Day: %days% Year: %years%
- echo -
- echo Behavior: %acting%
- echo -
- echo Grain: %grain%
- echo Livestock: %livestock%
- if %daysUntilRaid% GTR 0 echo -
- if %daysUntilRaid% GTR 0 echo Days Remaining Until Raid:%daysUntilRaid%
- echo -
- echo Raid Roll: %raidChance%/50
- echo -----------------------------------------
- echo 1- %state% Time
- echo 2- Management
- echo 3- Options
- echo -----------------------------------------
- choice /d 4 /t %timeRate% /c 1234 /n >nul
- if %errorlevel% == 1 (
- if %raidToggle% EQU 1 (
- if %daysUntilRaid% EQU 0 (
- goto raidOutcome
- )
- )
- if %time% EQU 1 (
- set time=0
- set timeRate=9999
- set state=Start
- ) else (
- set state=Stop
- set time=1
- set timeRate=2
- )
- )
- if %errorlevel% == 2 (
- goto management
- )
- if %errorlevel% == 3 (
- goto options
- )
- if %errorlevel% == 4 (
- if %time% EQU 1 (
- call :progress
- )
- )
- goto game
- :raided
- set /a raidType=%random%%%2+1
- if %militia% GTR 0 (
- set /a fleeChances=%random%%%100+1
- set /a fleeChance=%militia%*2
- if %fleeChances% GEQ %fleeChance% (
- set /a raidType=3
- )
- )
- set /a halfGrain=%grain% / 2
- set /a halfPop=%villagers% / 2
- set /a halfMil=%militia% / 3
- set /a deathTollVillagers=%random%%%%halfPop%+1
- set /a deathTollMilitia=%random%%%%halfMil%+1
- set /a grainLoss=%random%%%%halfGrain%+1
- call :raidTypes
- set /a raids+=1
- set raidToggle=0
- goto:eof
- :raidTypes
- if %raidType% EQU 1 (
- set raidedType=They didn't want your goods they wanted death! %deathTollVillagers% Villagers and %deathTollMilitia% Militia lives had been lost in the Raid!
- set /a villagers-=%deathTollVillagers%
- set /a militia-=%deathTollMilitia%
- )
- if %raidType% EQU 2 (
- set raidedType=To not hurt anyone, the Raiders were quite hungry and stole %grainLoss% grain from the village!
- set /a grain-=%grainLoss%
- )
- if %raidType% EQU 3 (
- set raidedType=To flee your borders, your militia force diswayed them from attacking! %fleeChances%/%fleeChance%
- )
- goto:eof
- :raidOutcome
- call :raided
- cls
- echo -------------------------------------
- echo The Village of %name% is being Raided!
- echo The Raiders decided, %raidedType%
- echo -------------------------------------
- echo
- pause>nul
- goto game
- :raidTimer
- if %raidChance% GTR 50 (
- set raidToggle=1
- set /a daysUntilRaid=%random%%%120+1
- )
- goto:eof
- :progress
- if %raidToggle% EQU 0 (
- set /a days+=1
- set /a gold+=%pop%+%tax%
- set /a raidChance=%random%%%65+1
- call :raidTimer
- )
- if %raidToggle% EQU 1 (
- if %daysUntilRaid% EQU 0 (
- set time=0
- set timeRate=9999
- set state=Raid
- )
- if %daysUntilRaid% GTR 0 (
- set /a days+=1
- set /a gold+=%pop%+%tax%
- set /a daysUntilRaid-=1
- )
- )
- if %resourceActs% EQU 1 (
- set /a grain+=%pop%+%grainSkill%
- )
- if %resourceActs% EQU 2 (
- if %grain% GEQ 15 (
- set /a grain-=15
- set /a livestock+=1
- ) else (set resourceActs=1)
- )
- if %resourceActs% EQU 3 (
- if %grain% GEQ 15 (
- if %livestock% GEQ 1 (
- set /a grain-=15
- set /a livestock-=1
- set /a villagers+=2
- ) else (set resourceActs=1)
- ) else (set resourceActs=1)
- )
- goto:eof
- :management
- cls
- echo ----------------------------------
- echo Management
- echo ----------------------------------
- echo 1- Actions
- echo 2- Stock
- echo 3- Return
- echo ----------------------------------
- choice /c 123 /n >nul
- if %errorlevel% == 1 (
- goto villageActions
- )
- if %errorlevel% == 2 (
- call :stock
- )
- if %errorlevel% == 3 (
- goto game
- )
- goto management
- :villageActions
- cls
- echo ------------------------------------
- echo Actions
- echo ------------------------------------
- echo 1- Resource Managment
- echo 2- Citizen Management
- echo 3- Return
- echo ------------------------------------
- choice /c 123 /n >nul
- if %errorlevel% == 1 (
- cls
- echo ------------------------
- echo Grain: %grain%
- echo Livestock: %livestock%
- echo ------------------------
- echo 0-No Action
- echo 1-Grow Grain
- echo 2-Raise Livestock -Consumes -15 Grain
- echo 3-Grow Population -Consumes -1 Livestock and -15 Grain
- echo ------------------------
- set /p resourceActs=Enter Action to Take:
- call :actionTaken
- )
- if %errorlevel% == 3 (
- goto management
- )
- goto villageActions
- :actionTaken
- if %resourceActs% EQU 0 (
- echo The Village will take no action
- )
- if %resourceActs% EQU 1 (
- echo The Village will now Grow Grain.
- )
- if %resourceActs% EQU 2 (
- echo The Village will now Raise Livestock.
- )
- if %resourceActs% EQU 3 (
- echo The Village will now consume to flourish.
- )
- pause>nul
- goto:eof
- :stock
- cls
- echo ---------------------------------
- echo Stock
- echo ---------------------------------
- echo Grain: %grain%
- echo Livestock: %livestock%
- echo ---------------------------------
- pause>nul
- goto:eof
Advertisement
Advertisement