Aller au contenu

Photo

Couple of questions related to Talent coding


  • Veuillez vous connecter pour répondre
1 réponse à ce sujet

#1
TimelordDC

TimelordDC
  • Members
  • 923 messages
I have a couple of questions related to talent coding:

1) How does the engine know how many hits landed?
The code for handling some of the abilities (like Riposte, Shield Pummel) checks if nHit is greater than 1 (or in some cases, equal to 2, etc to determine which hit we are handling).

   a) How does the engine know that all hits connected? Is it tied to the animation and collision logic?
   B) Or is it assumed that there are automatically 'x' number of hits for an ability and we just do a Combat_GetAttackResult with appropriate modifiers (where applicable) to determine if it is a hit or not?
   c) Or is the specific handling code called for each hit? In which case, it goes back to (a) again.

2) I want to code a Charge ability that will allow the warrior to charge through to the target - applying a movement speed modifier based on the distance between the attacker and target. Additionally, there should be a stamina decrease while he is moving and a damage bonus proportional to the amount of time he was moving.

This is designed as an activated ability but I am not sure if that is possible since there is a lag between the activation and the actual hit animation. So, if I set it up as an activated ability, will it work? If not, how can I do it? 

Thanks!

Modifié par TimelordDC, 09 mars 2010 - 04:51 .


#2
TimelordDC

TimelordDC
  • Members
  • 923 messages
Sorry for the bump! Anyone have any ideas?

(1) is the main question since I have coded new abilities and wondering if I need the new animations for them to be working properly. Code for one such ability -
-----------------------------------------------
        case ABILITY_TALENT_AAA_RINGEN:
        // First hit deals a knockdown effect without damage. Add movement modifier
        // Second hit is critical if it connects
        {
            // First attack
                object oWeapon = GetItemInEquipSlot(INVENTORY_SLOT_MAIN, stEvent.oCaster);
                            int nResult = Combat_GetAttackResult(stEvent.oCaster, stEvent.oTarget, oWeapon, AAA_RINGEN_THROW_ATTACK_MODIFIER, stEvent.nAbility);
            
                if(IsCombatHit(nResult))
                            {
                                                if (stEvent.nHit == 1)
                                                {
               //do stuff here
                                                }
                                                else if (stEvent.nHit == 2)
                     {
               // do stuff here
                                 }
                break;
        }

Edit: Removed actual code since it is not relevant to the question at hand.

Modifié par TimelordDC, 09 mars 2010 - 05:03 .