diff options
| author | fusion32 <marcopuzziello@gmail.com> | 2025-08-31 00:13:12 -0300 |
|---|---|---|
| committer | fusion32 <marcopuzziello@gmail.com> | 2025-08-31 00:14:12 -0300 |
| commit | 738986011731a36bfc6370befe2150e50f77d105 (patch) | |
| tree | 6aab417e45b8ebdc08c3e1b274857143456cec43 | |
| parent | 8adb2da8c3c5c25ff32eae80a59781290fc2cfcf (diff) | |
| download | game-738986011731a36bfc6370befe2150e50f77d105.tar.gz game-738986011731a36bfc6370befe2150e50f77d105.zip | |
add missing condition for monster spell casting
| -rw-r--r-- | src/crnonpl.cc | 86 |
1 files changed, 44 insertions, 42 deletions
diff --git a/src/crnonpl.cc b/src/crnonpl.cc index e7fb9b4..3ec73dc 100644 --- a/src/crnonpl.cc +++ b/src/crnonpl.cc @@ -2593,57 +2593,59 @@ void TMonster::IdleStimulus(void){ } if(Impact != NULL){ - switch(SpellData->Shape){ - case SHAPE_ACTOR:{ - int Effect = SpellData->ShapeParam1; - ActorShapeSpell(this, Impact, Effect); - break; - } + if(!Impact->isAggressive() || (this->Target != 0 && this->Target != this->Master)){ + switch(SpellData->Shape){ + case SHAPE_ACTOR:{ + int Effect = SpellData->ShapeParam1; + ActorShapeSpell(this, Impact, Effect); + break; + } - case SHAPE_VICTIM:{ - if(Target != NULL){ - this->Rotate(Target); + case SHAPE_VICTIM:{ + if(Target != NULL){ + this->Rotate(Target); - int Range = SpellData->ShapeParam1; - int Animation = SpellData->ShapeParam2; - int Effect = SpellData->ShapeParam3; - VictimShapeSpell(this, Target, Range, - Animation, Impact, Effect); + int Range = SpellData->ShapeParam1; + int Animation = SpellData->ShapeParam2; + int Effect = SpellData->ShapeParam3; + VictimShapeSpell(this, Target, Range, + Animation, Impact, Effect); + } + break; } - break; - } - case SHAPE_ORIGIN:{ - int Radius = SpellData->ShapeParam1; - int Effect = SpellData->ShapeParam2; - OriginShapeSpell(this, Radius, Impact, Effect); - break; - } + case SHAPE_ORIGIN:{ + int Radius = SpellData->ShapeParam1; + int Effect = SpellData->ShapeParam2; + OriginShapeSpell(this, Radius, Impact, Effect); + break; + } - case SHAPE_DESTINATION:{ - if(Target != NULL){ - this->Rotate(Target); + case SHAPE_DESTINATION:{ + if(Target != NULL){ + this->Rotate(Target); - int Range = SpellData->ShapeParam1; - int Animation = SpellData->ShapeParam2; - int Radius = SpellData->ShapeParam3; - int Effect = SpellData->ShapeParam4; - DestinationShapeSpell(this, Target, Range, - Animation, Radius, Impact, Effect); + int Range = SpellData->ShapeParam1; + int Animation = SpellData->ShapeParam2; + int Radius = SpellData->ShapeParam3; + int Effect = SpellData->ShapeParam4; + DestinationShapeSpell(this, Target, Range, + Animation, Radius, Impact, Effect); + } + break; } - break; - } - case SHAPE_ANGLE:{ - if(Target != NULL){ - this->Rotate(Target); - } + case SHAPE_ANGLE:{ + if(Target != NULL){ + this->Rotate(Target); + } - int Angle = SpellData->ShapeParam1; - int Range = SpellData->ShapeParam2; - int Effect = SpellData->ShapeParam3; - AngleShapeSpell(this, Angle, Range, Impact, Effect); - break; + int Angle = SpellData->ShapeParam1; + int Range = SpellData->ShapeParam2; + int Effect = SpellData->ShapeParam3; + AngleShapeSpell(this, Angle, Range, Impact, Effect); + break; + } } } |
