Sinisterly
[BATCH] HC's (First?) .Bat Combat Script (WIP) - Printable Version

+- Sinisterly (https://sinister.li)
+-- Forum: Coding (https://sinister.li/Forum-Coding)
+--- Forum: Coding (https://sinister.li/Forum-Coding--71)
+--- Thread: [BATCH] HC's (First?) .Bat Combat Script (WIP) (/Thread-BATCH-HC-s-First-Bat-Combat-Script-WIP)



[BATCH] HC's (First?) .Bat Combat Script (WIP) - ninja805 - 11-23-2013

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)
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 pause

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 ..

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 pause

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



RE: [BATCH] HC's (First?) .Bat Combat Script (WIP) - Psycho_Coder - 11-23-2013

Use code tags to post codes instead of using spoiler.

Like this :-

[*code]

// Put your content here

[*/code]

Just remove the *


RE: [BATCH] HC's (First?) .Bat Combat Script (WIP) - Psycho_Coder - 11-23-2013

Use code tags to post codes instead of using spoiler.

Like this :-

[*code]

// Put your content here

[*/code]

Just remove the *


RE: [BATCH] HC's (First?) .Bat Combat Script (WIP) - Inori - 01-03-2014

@ninja805 you should try and develop this in javascript! It's slightly more complicated but totally worth it!


RE: [BATCH] HC's (First?) .Bat Combat Script (WIP) - ninja805 - 01-04-2014

(01-03-2014, 07:39 PM)Zev Turner Wrote: @ninja805 you should try and develop this in javascript! It's slightly more complicated but totally worth it!

Yea, great idea! I'm about to go learn Javascript, too! I heard though that the benefits are beneficial .. Thanks for taking a look at the script! :Smile:


RE: [BATCH] HC's (First?) .Bat Combat Script (WIP) - Aut•ono•mous - 01-04-2014

Very nice script. Smile 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.


RE: [BATCH] HC's (First?) .Bat Combat Script (WIP) - Mamman777 - 01-04-2014

Wow this site is full of wapmasters


RE: [BATCH] HC's (First?) .Bat Combat Script (WIP) - Inori - 01-04-2014

yeah ninja a good site for learning JS is www.khanacadeny.org/cs


RE: [BATCH] HC's (First?) .Bat Combat Script (WIP) - ninja805 - 01-05-2014

(01-04-2014, 04:30 PM)Zev Turner Wrote: yeah ninja a good site for learning JS is www.khanacadeny.org/cs

Thanks man! I've been doing a little bit of Python, I hope to be able to learn both by 2015! :Smile:


RE: [BATCH] HC's (First?) .Bat Combat Script (WIP) - ninja805 - 01-05-2014

(01-04-2014, 04:30 PM)Zev Turner Wrote: yeah ninja a good site for learning JS is www.khanacadeny.org/cs

Thanks man! I've been doing a little bit of Python, I hope to be able to learn both by 2015! :Smile: