sillyEnthusiast wrote:Okay, so I'm trying to implement a simple combat system in which the player kills an enemy in exchange for a currency called grist to use the alchemiter as well as to build their house up so they can reach the first gate and get to their planet. However, I don't know how to make my weapons functional or set a combat system. I don't want strength, speed, etc. attributes, just a simple level-based system.
The best way I can think to explain it is the player starts at level 1, and likewise the small enemies up to the first gate are also level 1 and are 1-hit kills that grant so much grist. In an equation the system would look something like pl/el=h (pl=player level, el=enemy level, h=hits). And likewise, el/pl=h for an enemy to kill the player. Levels come from xp as well as better weapons.
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="xxx">
<version>1.0</version>
<gameid>xxx</gameid>
<author>HegemonKhan</author>
<pov type="object">player</pov>
<attr name="turns_integer" type="int">0</attr>
<statusattributes type="simplestringdictionary">turns_integer = Turns: !</statusattributes>
</game>
<object name="room">
<inherit name="editor_room" />
<object name="player">
<inherit name="editor_object" />
<inherit name="editor_player" />
<inherit name="character_object_type" />
</object>
<object name="monster_1_object">
<inherit name="editor_object" />
<inherit name="character_object_type" />
<attr name="experience_integer" type="int">5</attr>
<attr name="cash_integer" type="int">10</attr>
<attr name="right_hand_object" type="object">dagger_weapon_object</attr>
</object>
<object name="monster_2_object">
<inherit name="editor_object" />
<inherit name="character_object_type" />
<attr name="level_integer" type="int">2</attr>
<attr name="experience_integer" type="int">10</attr>
<attr name="cash_integer" type="int">50</attr>
<attr name="right_hand_object" type="object">shortsword_weapon_object</attr>
</object>
</object>
<object name="global_data_object">
<inherit name="editor_object" />
<object name="unarmed_weapon_object">
<inherit name="editor_object" />
<inherit name="weapon_object_type" />
<alias>unarmed</alias>
</object>
<object name="dagger_weapon_object">
<inherit name="editor_object" />
<inherit name="weapon_object_type" />
<alias>dagger</alias>
<attr name="damage_integer" type="int">2</attr>
</object>
<object name="shortsword_weapon_object">
<inherit name="editor_object" />
<inherit name="weapon_object_type" />
<alias>shortsword</alias>
<attr name="damage_integer" type="int">3</attr>
</object>
</object>
<turnscript name="global_turnscript">
<enabled />
<script>
leveling_function
game.turns_integer = game.turns_integer + 1
</script>
</turnscript>
<function name="leveling_function"><![CDATA[
if (game.pov.experience_integer >= game.pov.level_integer * 100 + 100) {
game.pov.experience_integer = game.pov.experience_integer - game.pov.level_integer * 100 + 100
game.pov.level_integer = game.pov.level_integer + 1
leveling_function
}
]]></function>
<function name="fight_function" parameters="self,enemy"><![CDATA[
// I got to think more about this, as it's more complex than I realized to get it to work right:
life_integer = ToInt (self.level_integer / enemy.level_integer
damage_integer = ToInt (self.right_hand.damage)
life_integer = life_integer - damage_integer
if (life_integer <= 0) {
}
]]></function>
<type name="character_object_type">
<attr name="level_integer" type="int">1</attr>
<attr name="experience_integer" type="int">0</attr>
<attr name="cash_integer" type="int">0</attr>
<attr name="right_hand_object" type="object">unarmed_weapon_object</attr>
<attr name="condition_stringlist" type="simplestringlist">normal</attr>
</type>
<type name="equipment_object_type">
<equip type="script">
</equip>
<unequip type="script">
</unequip>
</type>
<type name="weapon_object_type">
<inherit name="equipment_object_type" />
<attr name="damage_integer" type="int">1</attr>
</type>
</asl>
sillyEnthusiast wrote:However, I don't know how to make my weapons functional ...