Not sure how to attack mulitple enemies

I'm trying to make a Pokemon game.
Anyways, the problem is I can't get a good combat system. I tried using spawning objects and object lists, but I don't know how to attack multiple enemies, unless I use ThePixie's code. And they end up staying there anyways. I could try creating the objects and setting the attributes beforehand, but it seems like too much of a hassle, and also I/the player couldn't have the benefit of re-spawning enemies.
Does anybody have any ideas?

here's an example:

<object name="room">

<object name="player">
  <inherit name="playable_character_type" />
  <attr name="parent" type="object">room</attr>
  <attr name="current_life_integer_attribute" type="int">999</attr>
  <attr name="damage_integer_attribute" type="int">100</attr>

<object name="orc">
  <inherit name="monster_type" />
  <attr name="parent" type="object">room</attr>
  <attr name="current_life_integer_attribute" type="int">500</attr>
  <attr name="damage_integer_attribute" type="int">50</attr>

<object name="ogre">
  <inherit name="monster_type" />
  <attr name="parent" type="object">room</attr>
  <attr name="current_life_integer_attribute" type="int">750</attr>
   <attr name="damage_integer_attribute" type="int">75</attr>

<object name="troll">
  <inherit name="monster_type" />
  <attr name="parent" type="object">room</attr>
  <attr name="current_life_integer_attribute" type="int">250</attr>
  <attr name="damage_integer_attribute" type="int">25</attr>

<type name="monster_type">
  <inherit name="character_type" />

<type name="playable_character_type">
  <inherit name="character_type" />

<type name="character_type">
  <attr name="current_life_integer_attribute" type="int">1</attr>
  <attr name="damage_integer_attribute" type="int">1</attr>
  <attr name="condition_string_attribute" type="string">normal</attr>

<function name="populate_monster_objectlist_function">
  game.monster_objectlist_attribute = NewObjectList ()
  foreach (object_variable, GetDirectChildren (game.pov.parent) {
    if (DoesInherit (object_variable, "monster_type") and not object_variable.condition_string_attribute = "dead") {
      list add (game.monster_objectlist_attribute, object_variable)

<function name="combat_function">
  foreach (monster_object_variable, game.monster_objectlist_attribute) {
    // your scripting upon/for each monster, for simple example:
    monster_object_variable.current_life_integer_attribute = monster_object_variable.current_life_integer_attribute - game.pov.damage_integer_attribute
    game.pov.current_life_integer_attribute = game.pov.current_life_integer_attribute - monster_object_variable.damage_integer_attribute
    if (game.pov.current_life_integer_attribute < 1) {
      msg ("you were killed")
      msg ("GAME OVER")
    } else if (monster_object_variable.current_life_integer_attribute < 1) {
      monster_object_variable.condition_string_attribute = "dead"
      list remove (game.monster_objectlist_attribute, monster_object_variable)

Hey, if I make a game where, trolls, orcs, ogres, etc. are enemies, you won't be mad will you?

I actually had the exact same idea. Weird that this happened.


orcs, ogres, trolls, etc fantasy/legend/mythos/religious creatures are public domain, laughs.

if interested for ideas, I've compiled some-various rpg stuff here a long time ago (still a lot more to add):

feel free to use it and/or add to it (though we'd need to make a new thread as it's closed due to inactivity)


I thought you were making a pokemon game?

I've never played pokemon, but I don't think there's orcs, ogres, and trolls in it, lol.

This topic is now closed. Topics are closed after 60 days of inactivity.