Slime Squisher
Posts: 354
Joined: Thursday, 14th April 2011, 17:28
Coding an Aura
What I want, is a doughnut shaped "silence" aura. ie, it affects a square 2 tiles around the player, but not the tile the player is standing on.
I can achieve an easy silence aura by just returning the radius I want in the silence_radius(), but that silences the player also. Not exactly what I need here :p
I do C#, not so much C++
If anyone has any insight, I'd really appreciate it!
coord-circle.h
coord-circle.cc
- Code:
void circle_def::init(int param, circle_type ctype)
{
switch (ctype)
{
case C_CIRCLE:
radius_sq = param;
radius = isqrt_ceil(radius_sq);
break;
case C_ROUND:
radius = param;
radius_sq = radius * radius + 1;
break;
case C_POINTY:
radius = param;
radius_sq = radius * radius;
break;
case C_SQUARE:
radius = param;
break;
case C_DOUGHNUT:
radius = param;
radius_sq = (radius - origin.rdist()); // I don't think this will work, it returns an int, but is what I want even possible using this method?
}
is_square = (ctype == C_SQUARE);
init_bbox();
}
Busy dying horrible deaths from chugging too many pots of Mutation.