TWiki Home Tharsis . Combat . ExistingCombatSystem Tharsis webs:
Design | Guilds | Combat | Website
Combat . { Home | Changes | Index | Search | Go }
The existing combat system for Tharsis Gate is very inflexible and hard to change. Large amounts of data are stored in the player objects and the entire process is managed by the player object.

Currently it works as:

Crappy things:

Things to think about

The Code

I've been making a few changes to the way this works, as part of the process of alleviating bits of these problems and moving towards a platform that allows us to fix the whole lot.

The code as it currently stands is:

Object Method Purpose
Living hit_player used to deal damage to a player. Delegates to living->hit_player_from
Living hit_player_from used to deal damage to a player. Delegates to combat_d->hit_player_from
Living attack It performs a single combat round for the living. Delegates to combat_d->attack().
Living heartbeat ...
BasePlayer hit_player_from Overrides living version to do hp reporting if it changes
Player hit_player_from Overrides BasePlayer version to do pk checks
Combat_D hit_player_from Does way more than it should? Checks for starts combat for the target, alters damage based on armour, alters target hp, checks for and handles target death (calls living->second_life), handles whimpy running.
Combat_D attack Handles an single attack from an attacker to a target. Will stop combat with the target if the living can not attack the target (living->query_may_attack()), will chose an alternative target in this case. Delegates to Combat_D->swing()
Combat_D execute_round Performs a single combat round for a living. Determines how many attacks the living gets and calls Combat_D->attack() for each
Combat_D swing Does one combat swing for a living against a target. Works out if the swing is a hit, determines base damage, delegates to living->hit_player() to deal the damage - which might alter it, does the "hit message", does the "You killed" message

-- FantoM - 24 Mar 2006

Topic ExistingCombatSystem . { Edit | Attach | Ref-By | Printable | Diffs | r1.4 | > | r1.3 | > | r1.2 | More }
Revision r1.4 - 25 Mar 2006 - 11:47 GMT - FantoM
Parents: WebHome
Copyright © 2001 by the contributing authors. All material on this collaboration tool is the property of the contributing authors.
Ideas, requests, problems regarding Tharsis? Send feedback.