Show
Ignore:
Timestamp:
11/19/08 13:36:54 (17 years ago)
Author:
yumileroy
Message:

[svn] Add SpellExtraInfoMap?. Currently support:
Limited-number-of-players spell; shared damage spell; target-in-line cone spell (e.g. dark glare).
Change angle of cone spells from 120 degree to 60 degree.

Original author: megamage
Date: 2008-10-25 15:46:52-05:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/src/game/Unit.cpp

    r102 r110  
    34473447{ 
    34483448    return IsWithinDistInMap(target, distance) && !HasInArc( 2 * M_PI - arc, target ); 
     3449} 
     3450 
     3451bool Unit::isInLine(Unit const* target, float distance) const 
     3452{ 
     3453    if(!HasInArc(M_PI, target) || !IsWithinDistInMap(target, distance)) return false; 
     3454    float width = (GetObjectSize() / 2 + target->GetObjectSize()) / 2; 
     3455    float angle = GetAngle(target); 
     3456    angle -= GetOrientation(); 
     3457    return abs(sin(angle)) * distance < width; 
    34493458} 
    34503459