Thread: NPC Battles?
View Single Post
  #1  
Old 03-15-2016, 09:38 PM
Abronsyth's Avatar
Abronsyth Abronsyth is offline
A Headache Embodied
 
Join Date: Aug 2011
Location: NY
Posts: 1,011
Gender: Male
Credits: 117,190
Abronsyth is on a distinguished road
Default NPC Battles?

OK, so I have this idea for NPC battles that'd actually be fairly simple to pull off, but could be made to look cool, haha.

On my site I am adding stats. For this post I'm going to use "magic" as the default stat for the sake of example.

So all pets on my site have Magic ranging from 1 to 100. Now I want to create a set of NPCs who will be randomly generated (I already can do this so this part isn't important), and they'll have their own stats. So say I am going to battle, and I have a cat who has 50 Magic. The random-NPC, we'll call him Angry Cat, has 55 magic. Because Angry Cat has higher stat(s), he wins the battle if I choose to use Magic. However, let's say my cat has 60 Intelligence, and Angry Cat only has 30 Intelligence. So I choose to have my cat attack using intelligence (don't question it), and may cat wins.

Now here are the issues I'm running into:
A) selecting the cat I want to use to battle
>>>>I'm think that this is where the spotlight pet could come in handy. The pet you select as your spotlight could be the one who does the NPC battling. However, I need then to know how to select the pet the user has selected as their spotlight adoptable, and get that pet's stats.

B) choosing the attack
>>>>However, I think I can use if($mysidia->input->post("submit")) (but change "submit") to select the attack? Say I have each attack as buttons:
[Spell Cast] [Trick] [Tackle]
They push "Spell Cast" which will be known action-wise as "spell". Then we do if($mysidia->input->post("spell")) and then just select the adoptable's magic, and the NPC's magic within that. So this might not actually be a problem.

So it's not the fanciest of systems, but once I get everything figured out I should be able to do a lot more with it. I'd probably be able to incorporate health that decreases with each blow, giving more powerful NPCs the edge by making it so if their stat is in a certain interval then the damage they deal has a chance of hitting harder.

Of course as soon as I get it all set up I'll release it to the community as a mod :)

If anyone has suggestions/advice that'd be super awesome!
-Abron
__________________
My Mods Site (1.3.4, 2020 Mods)
Reply With Quote