~ares-developers/ares/gd03

« back to all changes in this revision

Viewing changes to src/Ext/WeaponType/Hooks.Beam.cpp

  • Committer: Renegade
  • Date: 2010-05-29 08:12:17 UTC
  • Revision ID: git-v1:0a1bb6321f04d723afe64d1b843dc87b4da783ec
Creating /trunk/src.

git-svn-id: svn://svn.renegadeprojects.com/ares/trunk@622 859b54a9-7a54-0410-aeb3-f8d2f1fa40fd

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "Body.h"
 
2
#include "../Techno/Body.h"
 
3
 
 
4
DEFINE_HOOK(6FD64A, TechnoClass_FireRadBeam1, 6)
 
5
{
 
6
        byte idxWeapon = *(byte *)(R->Stack32(0x18) + 0xC); // hack! 0x18 fetches the caller's EBP, which gives us access to its locals, including idxWeapon
 
7
        GET_STACK(TechnoClass *, Techno, 0x14);
 
8
 
 
9
        TechnoExt::ExtMap.Find(Techno)->idxSlot_Beam = idxWeapon;
 
10
 
 
11
        R->Stack<int>(0x0, idxWeapon);
 
12
        return 0;
 
13
}
 
14
 
 
15
// 6FD79C, 6
 
16
// custom RadBeam colors
 
17
DEFINE_HOOK(6FD79C, TechnoClass_FireRadBeam2, 6)
 
18
{
 
19
        GET(RadBeam *, Rad, ESI);
 
20
        GET_STACK(WeaponTypeClass *, pSource, 0xC);
 
21
 
 
22
        WeaponTypeExt::ExtData *pData = WeaponTypeExt::ExtMap.Find(pSource);
 
23
 
 
24
        if(pData->Beam_IsHouseColor) {
 
25
                GET(TechnoClass *, SourceUnit, EDI);
 
26
                Rad->Color = SourceUnit->Owner->Color;
 
27
        } else {
 
28
                Rad->Color = pData->Beam_Color;
 
29
        }
 
30
        Rad->Period = pData->Beam_Duration;
 
31
        Rad->Amplitude = pData->Beam_Amplitude;
 
32
        return 0x6FD7A8;
 
33
}