- Enemies with the "attack when provoked" setting only start attacking humans and structures if the attacker is a non-AI character or has a HumanAIController.
- Characters that launch a turret get assigned as the user of the projectile (-> shooting watchers with a railgun makes them attack). - Increased watchers' attack range.
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
<!-- head -->
|
||||
<limb id = "0" type="Head" width="350" height="320" steerforce="1.0" flip="true" armorsector="0.0,360.0" armorvalue="100.0">
|
||||
<sprite texture="Content/Characters/Watcher/watcher.png" sourcerect="0,0,369,348" depth="0.02" origin ="0.5,0.6"/>
|
||||
<attack range="150" duration="0.05" damage="200" stun="5" force="20" damagetype="blunt" targetforce="100"/>
|
||||
<attack range="250" duration="0.05" damage="200" stun="5" force="20" damagetype="blunt" targetforce="100"/>
|
||||
</limb>
|
||||
|
||||
<limb id = "1" radius="50" height="120" flip="true">
|
||||
|
||||
@@ -360,13 +360,16 @@ namespace Barotrauma
|
||||
updateTargetsTimer = Math.Min(updateTargetsTimer, 0.1f);
|
||||
coolDownTimer *= 0.1f;
|
||||
|
||||
if (amount > 0.1f && attackWhenProvoked)
|
||||
if (amount > 0.0f && attackWhenProvoked)
|
||||
{
|
||||
attackHumans = 100.0f;
|
||||
attackRooms = 100.0f;
|
||||
if (!(attacker is AICharacter) || (((AICharacter)attacker).AIController is HumanAIController))
|
||||
{
|
||||
attackHumans = 100.0f;
|
||||
attackRooms = 100.0f;
|
||||
}
|
||||
}
|
||||
|
||||
if (attacker==null || attacker.AiTarget==null) return;
|
||||
if (attacker == null || attacker.AiTarget == null) return;
|
||||
AITargetMemory targetMemory = FindTargetMemory(attacker.AiTarget);
|
||||
targetMemory.Priority += amount;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,8 @@ namespace Barotrauma.Items.Components
|
||||
{
|
||||
if (character != null && !characterUsable) return false;
|
||||
|
||||
User = character;
|
||||
|
||||
Launch(new Vector2(
|
||||
(float)Math.Cos(item.body.Rotation),
|
||||
(float)Math.Sin(item.body.Rotation)) * launchImpulse * item.body.Mass);
|
||||
|
||||
@@ -190,7 +190,7 @@ namespace Barotrauma.Items.Components
|
||||
}
|
||||
}
|
||||
|
||||
Launch(projectiles[0].Item);
|
||||
Launch(projectiles[0].Item, character);
|
||||
|
||||
if (character != null)
|
||||
{
|
||||
@@ -200,7 +200,7 @@ namespace Barotrauma.Items.Components
|
||||
return true;
|
||||
}
|
||||
|
||||
private void Launch(Item projectile)
|
||||
private void Launch(Item projectile, Character user = null)
|
||||
{
|
||||
reload = reloadTime;
|
||||
|
||||
@@ -217,6 +217,7 @@ namespace Barotrauma.Items.Components
|
||||
if (projectileComponent != null)
|
||||
{
|
||||
projectileComponent.Use((float)Timing.Step);
|
||||
projectileComponent.User = user;
|
||||
}
|
||||
|
||||
if (projectile.Container != null) projectile.Container.RemoveContained(projectile);
|
||||
|
||||
Reference in New Issue
Block a user