[BATCH] HC's (First?) .Bat Combat Script (WIP) 11-23-2013, 03:07 AM
#1
Hi guys!
*** NOTE, Anybody can use this for any project! :Grin:
While I'm not the best at .Bat, I have a "mostly" advanced knowledge of it from my dad and my self-taught learning. I just recently thought of something that caught my eye(Should I say brain?), a combat system for .Batch code! I've been working on my own .Batch game myself and have been trying to figure that out, I've also been looking at other people's games for inspiration and have noticed that no one has a combat script. (If you do have one/already know this, then I'm sorry for wasting your time!)
Why do none of the .Batch games ( That I've seen ) have a combat script? I believe it is because: 1. It is slightly (very) buggy and 2. People might not have thought of this. I have been studying this for a week now and I am here to post my thoughts of what the solution is, and may I say .. it is quite simple!
Before I show you this, please note that for the numbers to be solved it might take a minute! It is because the system has to go through many, many numbers. I hope this helps people! :Grin: (And as I said before, I am NOT the best coder.)
Fully-Working Code (Defense)
Now this code is having SOME trouble .. It is both the Attack and Defense script, I left the "if %boarhealth% LSS 1 goto
if %boarhealth% GEQ 1 goto :attackofleboa" blank so that if someone wanted to change the LSS 1 variable to (F.E.) another l33t boar or elsewhere ..
This might look junky and clattered .. I've been sick! :Frown: I haven't been feeling good enough to heavily work on something, sorry! :Sick:
- Adam
*** NOTE, Anybody can use this for any project! :Grin:
While I'm not the best at .Bat, I have a "mostly" advanced knowledge of it from my dad and my self-taught learning. I just recently thought of something that caught my eye(Should I say brain?), a combat system for .Batch code! I've been working on my own .Batch game myself and have been trying to figure that out, I've also been looking at other people's games for inspiration and have noticed that no one has a combat script. (If you do have one/already know this, then I'm sorry for wasting your time!)
Why do none of the .Batch games ( That I've seen ) have a combat script? I believe it is because: 1. It is slightly (very) buggy and 2. People might not have thought of this. I have been studying this for a week now and I am here to post my thoughts of what the solution is, and may I say .. it is quite simple!
Before I show you this, please note that for the numbers to be solved it might take a minute! It is because the system has to go through many, many numbers. I hope this helps people! :Grin: (And as I said before, I am NOT the best coder.)
Fully-Working Code (Defense)
Code:
@echo off
cls
echo You are a warrior
echo You have 15 HP.
echo Use it wisely!
set health=15
pause
cls
echo =========================================
echo A 1337 WILD BOAR APPEARS
echo =========================================
echo LEVEL 9001
echo CHARGE = 15 DMG
echo =========================================
echo You charge at the 1337 Wild Boar!
echo The Boar uses Charge!
cls
:attackofleboar
set /a health1=%random%
if /i %health1% GTR 13 goto :attackofleboar
if /i %health1% LSS 13 goto :attackofleboar
echo You Recieve %health1% Damage!
pause
set /a health-=%health1%
cls
echo Because sometimes .. Boars just want to watch the world burn.
echo Oh no, you have %health%!
if %health% LSS 1 exit
if %health% GEQ 1 goto :attackofleboar
pauseNow this code is having SOME trouble .. It is both the Attack and Defense script, I left the "if %boarhealth% LSS 1 goto
if %boarhealth% GEQ 1 goto :attackofleboa" blank so that if someone wanted to change the LSS 1 variable to (F.E.) another l33t boar or elsewhere ..
Code:
@echo off
cls
echo You are a warrior
echo You have 15 HP.
echo Use it wisely!
set health=15
set boar1health=6
rem This section calculates the Boar's health
pause
cls
:boar
echo =========================================
echo A 1337 WILD BOAR APPEARS
echo =========================================
echo LEVEL 9001
echo CHARGE = 2-3 DMG
echo =========================================
echo You charge at the 1337 Wild Boar!
echo The Boar uses Charge!
cls
:attacktoboar
echo %boarhealth% damage!
set /a boarhealth=%random%
if /i %boarhealth% GTR 6 goto :attacktoboar
if /i %boarhealth% LSS 6 goto :attacktoboar
echo You Deal %boarhealth% Damage!
pause
set /a boarhealth-=%boar1health%
cls
echo Because sometimes .. Boars just want to watch the world burn.
echo The boar has %boarhealth%!
if %boarhealth% LSS 1 goto
if %boarhealth% GEQ 1 goto :attackofleboar
pause
cls
:attackofleboar
set /a health1=%random%
if /i %health1% GTR 3 goto :attackofleboar
if /i %health1% LSS 2 goto :attackofleboar
echo You Recieve %health1% Damage!
pause
set /a health-=%health1%
cls
echo Because sometimes .. Boars just want to watch the world burn.
echo Oh no, you have %health%!
if %health% LSS 1 exit
if %health% GEQ 1 goto :attacktoboar
pauseThis might look junky and clattered .. I've been sick! :Frown: I haven't been feeling good enough to heavily work on something, sorry! :Sick:
- Adam
(This post was last modified: 11-23-2013, 05:14 PM by Spotifly.)


![[+]](https://sinister.li/images/modern/collapse_collapsed.png)
![[Image: OilyCostlyEwe.gif]](http://fat.gfycat.com/OilyCostlyEwe.gif)















I have a similar script about a hacker evading the NSA & clearing harddrives full of data ..I haven't done much with it because of lack of creativity lately, though.
![[Image: Free_Logo_autonomous..png]](https://dl.dropboxusercontent.com/u/18833908/Free_Logo_autonomous..png)