Dev C++ Fighting Game

Main only tests a fight between Hume vs Elf and Hume vs Balrog for now (Hume is way overpowerful, oops). My problem is this: Every run of the program produces the same results. Same damage, same blocks, same double attacks, same winners, everything. I thought rand was supposed to randomize the outcome in this situation? What am I doing wrong? Pirate bay.

Hey everyone,

I'm still tweaking the attributes but here is what I've got:

Numark mixtrack 3 traktor mapping. All races: dmg = rand, where 0 < r < str

Human
25% chance of blocking
5% chance of double attack (attack x2)
10% chance of dmg+60

Elf
5% chance of blocking
35% chance of double attack

Game Dev Story

Balrog
35% chance of attacking twice

Cyberdemon
35% chance of blocking


Balrog and Cyberdemon are inherited from Demon; all objects of class Demon have a 10% chance of inflicting dmg+50.

Pdf download cooking. Academia.edu is a platform for academics to share research papers. Free Ebook and PDF Cookbooks, Free Cooking Software, and Culinary and Cooking Articles. DDV CULINARY WEBSITE. CULINARY ARTICLES AND RECIPES. FREE COOKBOOKS DDV CULINARY Free PDF Cookbooks To Download a PDF Cook Book: Right Click on a PDF name or the 'down arrow'. Pdf On Cooking: A Textbook of Culinary Fundamentals (6th Edition) (What's New in Culinary & Hospitality. Download eBooks for Cooking PDF, MOBI, EPUB, AZW3. Download eBooks for Cooking PDF, MOBI, EPUB, AZW3. Skip to content. Download eBooks for Cooking PDF, MOBI, EPUB, AZW3. Scroll down to content. Posted on 2020-04-16. MASTERING PIZZA by Mark Sell PDF: B0874TV3CR. Download free Cookbooks (TruePDF, EPUB, AZW3, PDF) in english.

My code (very few comments so far, sorry):

main() only tests a fight between Hume vs Elf and Hume vs Balrog for now (Hume is way overpowerful, oops).

My problem is this:
Every run of the program produces the same results. Same damage, same blocks, same double attacks, same winners, everything. I thought rand() was supposed to randomize the outcome in this situation? What am I doing wrong?

Thanks for any help!

  • 3 Contributors
  • forum 6 Replies
  • 111 Views
  • 9 Hours Discussion Span
  • commentLatest Postby MoucheLatest Post

WaltP2,905

My code (very few comments so far, sorry):

C++

Why do people apologise for doing bad things rather than just doing what they know they should? :icon_confused:

My problem is this:
Every run of the program produces the same results. Same damage, same blocks, same double attacks, same winners, everything. I thought rand() was supposed to randomize the outcome in this situation? What am I doing wrong?

Dev C++ Game Code

Not wanting to waste time looking through 400+ lines of code for that 1 wayward statement, all I can suggest without you being more specific is that srand() should only be called once at the beginning of the program.

If this doesn't help, give us a clue as to what to look at.