Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- title Village Manager
- setlocal enabledelayedexpansion
- color 0e
- :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
- 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
- rem Caravan variables
- set caravanActive=0
- set caravanTimer=0
- set caravanGold=0
- set caravanGrain=0
- set caravanType=0
- set friendlyCaravanActive=0
- set /a daysUntilFriendlyCaravan=%random% %% 30 + 10
- set confirm=
- 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 Management!
- 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%
- if %friendlyCaravanActive% EQU 0 (
- echo Days until next friendly caravan: %daysUntilFriendlyCaravan%
- )
- echo -
- echo Raid Roll: %raidChance%/50
- echo -----------------------------------------
- echo 1- %state% Time
- echo 2- Management
- echo 3- Options
- echo -----------------------------------------
- if %caravanTimer% GTR 0 (
- echo Caravan Timer: %caravanTimer% days remaining
- )
- 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
- :friendlyCaravanArrives
- echo A friendly caravan has arrived at the village!
- set /a goldBonus=%random% %% 50 + 50
- set /a grainBonus=%random% %% 200 + 100
- set /a gold+=%goldBonus%
- set /a grain+=%grainBonus%
- echo +%goldBonus% gold and +%grainBonus% grain have been added to your stocks!
- set /a daysUntilFriendlyCaravan=%random% %% 30 + 10
- set friendlyCaravanActive=0
- pause
- goto :eof
- :raided
- set /a raidType=%random%%%2+1
- if %militia% GTR 0 (
- set /a fleeChances=%random% %% 100 + 1
- set /a fleeChance=%militia% * 2
- if %fleeChance% GTR 70 set fleeChance=70
- if %fleeChances% LEQ %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 dissuaded 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
- :caravanState
- if %caravanType% EQU 1 (
- echo Caravan has been raided! All resources lost.
- set caravanGold=0
- set caravanGrain=0
- ) else (
- echo Caravan returned safely with %caravanGold% Gold and %caravanGrain% Grain.
- )
- echo Press any key to continue...
- pause>nul
- set caravanActive=0
- 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 %friendlyCaravanActive% EQU 0 (
- set /a daysUntilFriendlyCaravan-=1
- if %daysUntilFriendlyCaravan% LEQ 0 (
- set friendlyCaravanActive=1
- call :friendlyCaravanArrives
- )
- )
- rem Caravan operations progress
- if %caravanTimer% GTR 0 (
- set /a caravanTimer-=1
- if %caravanTimer% EQU 0 (
- set /a caravanType=%random%%%2+1
- call :caravanState
- )
- ) else (
- set /a caravanGold+=3
- set /a caravanGrain+=3
- )
- ::echo Raid Toggle 1 If Remaining Days until Raid is 0 pause time and set the village state to raid haulting everything
- ::pause>nul
- 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
- )
- )
- ::echo Raid Toggle 2
- ::pause>nul
- 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
- )
- )
- ::echo Resource Act 1 and 2
- ::pause>nul
- 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
- )
- )
- ::echo Resource Act 3
- ::pause>nul
- goto:eof
- :management
- cls
- echo ----------------------------------
- echo Management
- echo ----------------------------------
- echo 1- Actions
- echo 2- Stock
- echo 3- Citizen Management
- echo 4- Return
- echo ----------------------------------
- choice /c 1234 /n >nul
- if %errorlevel% == 1 goto villageActions
- if %errorlevel% == 2 call :stock
- if %errorlevel% == 3 goto citizenManagement
- if %errorlevel% == 4 goto game
- goto management
- :villageActions
- cls
- echo ------------------------------------
- echo Actions
- echo ------------------------------------
- echo 1- Resource Management
- echo 2- Caravan Operations
- echo 3- Return
- echo ------------------------------------
- choice /c 123 /n >nul
- if %errorlevel% == 1 goto resourceManagement
- if %errorlevel% == 2 goto caravanOperations
- if %errorlevel% == 3 goto game
- goto villageActions
- :resourceManagement
- cls
- echo ------------------------------------
- echo Resource Management
- echo ------------------------------------
- echo 1- Grow Grain
- echo 2- Raise Livestock -15 Grain
- echo 3- Grow Population -1 Livestock, -15 Grain
- echo 4- Return
- echo ------------------------------------
- choice /c 1234 /n >nul
- if %errorlevel% == 1 (
- set /a resourceActs=1
- )
- if %errorlevel% == 2 (
- set /a resourceActs=2
- )
- if %errorlevel% == 3 (
- set /a resourceActs=3
- )
- if %errorlevel% == 4 goto villageActions
- call :actionTaken
- goto resourceManagement
- :actionTaken
- 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 Expand Population.
- echo.
- pause
- goto:eof
- :caravanOperations
- cls
- echo ------------------------------------
- echo Caravan Operations
- echo ------------------------------------
- echo 1- Send Out Caravan
- echo 2- Recall Caravan
- echo 3- Check Caravan Status
- echo 4- Return to Actions Menu
- echo ------------------------------------
- choice /c 1234 /n >nul
- if %errorlevel% == 1 (
- if %caravanActive% EQU 1 (
- echo A caravan is already out.
- pause
- ) else (
- rem Check if enough resources to send caravan
- if %gold% GEQ 20 if %grain% GEQ 10 (
- echo Confirm sending a caravan, it will cost 20 gold and 10 grain. [1/2]
- set /p confirm=1 Yes or 2 No:
- if /I "!confirm!"=="1" (
- call :sendCaravan
- )
- ) else (
- echo Not enough resources to send a caravan! Need at least 20 gold and 10 grain.
- pause
- )
- )
- )
- if %errorlevel% == 2 (
- if %caravanActive% EQU 1 (
- echo Confirm you want to recall the caravan? [1/2]
- set /p confirm=1 Yes or 2 No:
- if /I "!confirm!"=="1" (
- call :recallCaravan
- )
- ) else (
- echo No caravan is currently out.
- pause
- )
- )
- if %errorlevel% == 3 (
- if %caravanActive% EQU 1 (
- echo Caravan currently out: %caravanGold% gold and %caravanGrain% grain collected so far.
- echo Days remaining until return: %caravanTimer%
- ) else (
- echo No caravan is currently out.
- )
- pause
- )
- if %errorlevel% == 4 goto villageActions
- goto caravanOperations
- :sendCaravan
- cls
- echo Sending out a caravan...
- set /a gold-=20
- set /a grain-=10
- set /a caravanTimer=%random% %% 20 + 10
- set /a caravanGold=0
- set /a caravanGrain=0
- set caravanActive=1
- echo Caravan has been dispatched and will return in %caravanTimer% days.
- pause
- goto caravanOperations
- :recallCaravan
- cls
- echo Recalling the caravan...
- set /a gold+=%caravanGold%
- set /a grain+=%caravanGrain%
- echo Caravan has returned safely with %caravanGold% Gold and %caravanGrain% Grain.
- set caravanTimer=0
- set caravanActive=0
- pause
- goto caravanOperations
- :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 management
- :citizenManagement
- cls
- echo ------------------------------------
- echo Citizen Management
- echo ------------------------------------
- echo 1- Food Production Upgrade - Cost: 50 Gold
- echo 2- Gold Production Upgrade - Cost: 50 Gold
- echo 3- Increase Tax Rate
- echo 4- Decrease Tax Rate
- echo 5- Return
- echo ------------------------------------
- choice /c 12345 /n >nul
- if %errorlevel% == 1 call :foodProductionUpgrade
- if %errorlevel% == 2 call :goldProductionUpgrade
- if %errorlevel% == 3 call :increaseTaxRate
- if %errorlevel% == 4 call :decreaseTaxRate
- if %errorlevel% == 5 goto management
- goto citizenManagement
- :foodProductionUpgrade
- if %gold% GEQ 50 (
- set /a grainSkill+=1
- set /a gold-=50
- echo Food Production has been upgraded. Grain skill is now %grainSkill%.
- ) else (
- echo Not enough gold to upgrade food production.
- )
- pause>nul
- goto citizenManagement
- :goldProductionUpgrade
- if %gold% GEQ 50 (
- set /a tax+=1
- set /a gold-=50
- echo Gold Production has been upgraded. Tax rate is now %tax%.
- ) else (
- echo Not enough gold to upgrade gold production.
- )
- pause>nul
- goto citizenManagement
- :increaseTaxRate
- set /a tax+=1
- echo Tax rate has been increased. Current tax rate is %tax%.
- pause>nul
- goto citizenManagement
- :decreaseTaxRate
- if %tax% GEQ 1 (
- set /a tax-=1
- echo Tax rate has been decreased. Current tax rate is %tax%.
- ) else (
- echo Tax rate cannot be decreased further.
- )
- pause>nul
- goto citizenManagement
- :options
- cls
- echo -----------------------------------------
- echo Options
- echo -----------------------------------------
- echo 1- Village Name
- echo 2- Reset Game
- echo 3- Return
- echo -----------------------------------------
- choice /c 123 /n >nul
- if %errorlevel% == 1 goto name
- if %errorlevel% == 2 goto reset
- if %errorlevel% == 3 goto game
- goto options
- :name
- cls
- echo ------------------------------
- echo Current Village Name: %name%
- echo ------------------------------
- echo Enter New Village Name:
- set /p name=
- goto options
- :reset
- cls
- echo ------------------------
- echo Reset Game Data
- echo ------------------------
- echo 1- Yes
- echo 2- No
- echo ------------------------
- choice /c 12 /n >nul
- if %errorlevel% == 1 (
- call :data
- goto game
- )
- if %errorlevel% == 2 goto game
- goto options
Advertisement
Comments
-
- Who ever reported this for Abuse Content is a sad individual. There is nothing abusive about this Text Based Village Manager Game, it's neither malicious, harmful, or invasive. It's a literal game and someone decided to report it for no reason. Could it be Jealousy? Could it be Pettiness? Who knows.
Add Comment
Please, Sign In to add comment
Advertisement