It performs a single combat round for the living. Delegates to combat_d->attack(). Has problems because some weapons call attack() which means that the living gets multiple combat rounds, and each combat round might give a player several swings (eg when wearing the bracers).

>>

Living

attack

It performs a single combat round for the living. Delegates to combat_d->attack().

Living

heartbeat

...

Added:

>>

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

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(). Has problems because some weapons call attack() which means that the living gets multiple combat rounds, and each combat round might give a player several swings (eg when wearing the bracers).

%META:TOPICINFO{author="FantoM" date="1041989415" format="1.0" version="1.1"}%
%META:TOPICPARENT{name="WebHome"}%
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.

Having combat embeded in living objects allows, in theory although not in practice with the current code, the ability for certain monsters or monster types to have alternative forms of combat - like a flying monster attacking differently to a land based monster.