SFX batch 1 import and some implementation, minimap icons added
This commit is contained in:
@@ -99,173 +99,173 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
var container = new SimpleInjector.Container();
|
||||
container.Register<IPlayerLogic, PlayerLogic>(Lifestyle.Singleton);
|
||||
var container = new SimpleInjector.Container();
|
||||
container.Register<IPlayerLogic, PlayerLogic>(Lifestyle.Singleton);
|
||||
|
||||
PlayerLogic = container.GetInstance<IPlayerLogic>();
|
||||
PlayerLogic.Set(this as IPlayer);
|
||||
PlayerLogic.Set(Settings);
|
||||
PlayerLogic = container.GetInstance<IPlayerLogic>();
|
||||
PlayerLogic.Set(this as IPlayer);
|
||||
PlayerLogic.Set(Settings);
|
||||
|
||||
Inventory = new Inventory();
|
||||
HealthComponent = new HealthComponent(InitialHP);
|
||||
VTComponent = new VTComponent(InitialVT);
|
||||
AttackComponent = new AttackComponent(InitialAttack);
|
||||
DefenseComponent = new DefenseComponent(InitialDefense);
|
||||
ExperiencePointsComponent = new ExperiencePointsComponent();
|
||||
LuckComponent = new LuckComponent(InitialLuck);
|
||||
EquipmentComponent = new EquipmentComponent();
|
||||
Inventory = new Inventory();
|
||||
HealthComponent = new HealthComponent(InitialHP);
|
||||
VTComponent = new VTComponent(InitialVT);
|
||||
AttackComponent = new AttackComponent(InitialAttack);
|
||||
DefenseComponent = new DefenseComponent(InitialDefense);
|
||||
ExperiencePointsComponent = new ExperiencePointsComponent();
|
||||
LuckComponent = new LuckComponent(InitialLuck);
|
||||
EquipmentComponent = new EquipmentComponent();
|
||||
|
||||
_itemReroller = new ItemReroller(ItemDatabase.Instance);
|
||||
_itemReroller = new ItemReroller(ItemDatabase.Instance);
|
||||
|
||||
Settings = new PlayerLogic.Settings() { RotationSpeed = RotationSpeed, MoveSpeed = MoveSpeed, Acceleration = Acceleration };
|
||||
Settings = new PlayerLogic.Settings() { RotationSpeed = RotationSpeed, MoveSpeed = MoveSpeed, Acceleration = Acceleration };
|
||||
|
||||
PlayerBinding = PlayerLogic.Bind();
|
||||
PlayerBinding = PlayerLogic.Bind();
|
||||
|
||||
PlayerBinding
|
||||
.Handle((in PlayerLogic.Output.ThrowItem output) =>
|
||||
{
|
||||
})
|
||||
.Handle((in PlayerLogic.Output.Move output) =>
|
||||
{
|
||||
Move(output.delta);
|
||||
});
|
||||
PlayerBinding
|
||||
.Handle((in PlayerLogic.Output.ThrowItem output) =>
|
||||
{
|
||||
})
|
||||
.Handle((in PlayerLogic.Output.Move output) =>
|
||||
{
|
||||
Move(output.delta);
|
||||
});
|
||||
|
||||
PlayerLogic.Start();
|
||||
this.Provide();
|
||||
PlayerLogic.Start();
|
||||
this.Provide();
|
||||
}
|
||||
|
||||
public void ResetPlayerData()
|
||||
{
|
||||
foreach (var item in Inventory.Items)
|
||||
Inventory.Remove(item);
|
||||
foreach (var item in Inventory.Items)
|
||||
Inventory.Remove(item);
|
||||
|
||||
HealthComponent.Reset();
|
||||
VTComponent.Reset();
|
||||
AttackComponent.Reset();
|
||||
DefenseComponent.Reset();
|
||||
ExperiencePointsComponent.Reset();
|
||||
LuckComponent.Reset();
|
||||
EquipmentComponent.Reset();
|
||||
HealthComponent.Reset();
|
||||
VTComponent.Reset();
|
||||
AttackComponent.Reset();
|
||||
DefenseComponent.Reset();
|
||||
ExperiencePointsComponent.Reset();
|
||||
LuckComponent.Reset();
|
||||
EquipmentComponent.Reset();
|
||||
|
||||
HealthTimer.Timeout += OnHealthTimerTimeout;
|
||||
HealthTimer.Timeout += OnHealthTimerTimeout;
|
||||
}
|
||||
|
||||
#region Initialization
|
||||
public void OnReady()
|
||||
{
|
||||
Hitbox.AreaEntered += Hitbox_AreaEntered;
|
||||
CollisionDetector.AreaEntered += CollisionDetector_AreaEntered;
|
||||
SwordSlashAnimation.Position = GetViewport().GetVisibleRect().Size / 2;
|
||||
HealthComponent.HealthReachedZero += Die;
|
||||
HealthTimer.WaitTime = _healthTimerWaitTime;
|
||||
SetProcessInput(false);
|
||||
SetPhysicsProcess(false);
|
||||
Hitbox.AreaEntered += Hitbox_AreaEntered;
|
||||
CollisionDetector.AreaEntered += CollisionDetector_AreaEntered;
|
||||
SwordSlashAnimation.Position = GetViewport().GetVisibleRect().Size / 2;
|
||||
HealthComponent.HealthReachedZero += Die;
|
||||
HealthTimer.WaitTime = _healthTimerWaitTime;
|
||||
SetProcessInput(false);
|
||||
SetPhysicsProcess(false);
|
||||
}
|
||||
#endregion
|
||||
|
||||
public void Activate()
|
||||
{
|
||||
SetProcessInput(true);
|
||||
SetPhysicsProcess(true);
|
||||
SetHealthTimerStatus(HealthTimerIsActive);
|
||||
SetProcessInput(true);
|
||||
SetPhysicsProcess(true);
|
||||
SetHealthTimerStatus(HealthTimerIsActive);
|
||||
}
|
||||
|
||||
public void Deactivate()
|
||||
{
|
||||
SetProcessInput(false);
|
||||
SetPhysicsProcess(false);
|
||||
SetHealthTimerStatus(false);
|
||||
SetProcessInput(false);
|
||||
SetPhysicsProcess(false);
|
||||
SetHealthTimerStatus(false);
|
||||
}
|
||||
|
||||
private void SetHealthTimerStatus(bool isActive)
|
||||
{
|
||||
if (isActive)
|
||||
HealthTimer.Start();
|
||||
else
|
||||
HealthTimer.Stop();
|
||||
if (isActive)
|
||||
HealthTimer.Start();
|
||||
else
|
||||
HealthTimer.Stop();
|
||||
}
|
||||
|
||||
public void TeleportPlayer(Transform3D newTransform)
|
||||
{
|
||||
Transform = newTransform;
|
||||
Transform = newTransform;
|
||||
}
|
||||
|
||||
public void TakeDamage(AttackData damage)
|
||||
{
|
||||
var damageReceived = DamageCalculator.CalculateDamage(damage, DefenseComponent.CurrentDefense.Value + EquipmentComponent.BonusDefense, EquipmentComponent.ElementalResistance);
|
||||
HealthComponent.Damage(damageReceived);
|
||||
var damageReceived = DamageCalculator.CalculateDamage(damage, DefenseComponent.CurrentDefense.Value + EquipmentComponent.BonusDefense, EquipmentComponent.ElementalResistance);
|
||||
HealthComponent.Damage(damageReceived);
|
||||
}
|
||||
|
||||
public void Knockback(float impulse)
|
||||
{
|
||||
_knockbackStrength = impulse;
|
||||
_knockbackDirection = GlobalBasis.Z.Normalized();
|
||||
_knockbackStrength = impulse;
|
||||
_knockbackDirection = GlobalBasis.Z.Normalized();
|
||||
}
|
||||
|
||||
public void LevelUp()
|
||||
{
|
||||
var rng = new RandomNumberGenerator();
|
||||
rng.Randomize();
|
||||
var hpIncrease = rng.RandiRange(3, 6);
|
||||
HealthComponent.RaiseMaximumHP(hpIncrease);
|
||||
ExperiencePointsComponent.LevelUp();
|
||||
var rng = new RandomNumberGenerator();
|
||||
rng.Randomize();
|
||||
var hpIncrease = rng.RandiRange(3, 6);
|
||||
HealthComponent.RaiseMaximumHP(hpIncrease);
|
||||
ExperiencePointsComponent.LevelUp();
|
||||
}
|
||||
|
||||
public void Die()
|
||||
{
|
||||
HealthTimer.WaitTime = _healthTimerWaitTime;
|
||||
HealthTimer.Timeout -= OnHealthTimerTimeout;
|
||||
SwordSlashAnimation.Stop();
|
||||
SetProcessInput(false);
|
||||
SetPhysicsProcess(false);
|
||||
PlayerDied?.Invoke();
|
||||
HealthTimer.WaitTime = _healthTimerWaitTime;
|
||||
HealthTimer.Timeout -= OnHealthTimerTimeout;
|
||||
SwordSlashAnimation.Stop();
|
||||
SetProcessInput(false);
|
||||
SetPhysicsProcess(false);
|
||||
PlayerDied?.Invoke();
|
||||
}
|
||||
|
||||
public override void _Input(InputEvent @event)
|
||||
{
|
||||
if (@event.IsActionPressed(GameInputs.Attack))
|
||||
Attack();
|
||||
if (@event.IsActionPressed(GameInputs.Sprint))
|
||||
Settings.MoveSpeed *= 2;
|
||||
if (@event.IsActionReleased(GameInputs.Sprint))
|
||||
Settings.MoveSpeed /= 2;
|
||||
if (@event.IsActionPressed(GameInputs.Attack))
|
||||
Attack();
|
||||
if (@event.IsActionPressed(GameInputs.Sprint))
|
||||
Settings.MoveSpeed *= 2;
|
||||
if (@event.IsActionReleased(GameInputs.Sprint))
|
||||
Settings.MoveSpeed /= 2;
|
||||
}
|
||||
|
||||
public void OnPhysicsProcess(double delta)
|
||||
{
|
||||
PlayerLogic.Input(new PlayerLogic.Input.PhysicsTick(delta));
|
||||
PlayerLogic.Input(new PlayerLogic.Input.Moved(GlobalPosition, GlobalTransform));
|
||||
PlayerLogic.Input(new PlayerLogic.Input.PhysicsTick(delta));
|
||||
PlayerLogic.Input(new PlayerLogic.Input.Moved(GlobalPosition, GlobalTransform));
|
||||
}
|
||||
|
||||
public void Equip(EquipableItem equipable)
|
||||
{
|
||||
if (equipable.ItemTag == ItemTag.MysteryItem)
|
||||
{
|
||||
var rerolledItem = _itemReroller.RerollItem(equipable, Inventory);
|
||||
Equip(rerolledItem);
|
||||
return;
|
||||
}
|
||||
if (equipable.ItemTag == ItemTag.MysteryItem)
|
||||
{
|
||||
var rerolledItem = _itemReroller.RerollItem(equipable, Inventory);
|
||||
Equip(rerolledItem);
|
||||
return;
|
||||
}
|
||||
|
||||
EquipmentComponent.Equip(equipable);
|
||||
EquipmentComponent.Equip(equipable);
|
||||
}
|
||||
|
||||
public void Unequip(EquipableItem equipable)
|
||||
{
|
||||
EquipmentComponent.Unequip(equipable);
|
||||
EquipmentComponent.Unequip(equipable);
|
||||
}
|
||||
|
||||
private static Vector3 GlobalInputVector
|
||||
{
|
||||
get
|
||||
{
|
||||
var rawInput = Input.GetVector(GameInputs.MoveLeft, GameInputs.MoveRight, GameInputs.MoveUp, GameInputs.MoveDown);
|
||||
var input = new Vector3
|
||||
{
|
||||
X = rawInput.X,
|
||||
Z = rawInput.Y
|
||||
};
|
||||
return input with { Y = 0f };
|
||||
}
|
||||
get
|
||||
{
|
||||
var rawInput = Input.GetVector(GameInputs.MoveLeft, GameInputs.MoveRight, GameInputs.MoveUp, GameInputs.MoveDown);
|
||||
var input = new Vector3
|
||||
{
|
||||
X = rawInput.X,
|
||||
Z = rawInput.Y
|
||||
};
|
||||
return input with { Y = 0f };
|
||||
}
|
||||
}
|
||||
|
||||
private static float LeftStrafeInputVector => Input.GetActionStrength(GameInputs.StrafeLeft);
|
||||
@@ -274,140 +274,140 @@ public partial class Player : CharacterBody3D, IPlayer, IProvide<IPlayer>
|
||||
|
||||
private void Attack()
|
||||
{
|
||||
if (PlayerIsHittingGeometry())
|
||||
{
|
||||
AnimationPlayer.Play("hit_wall");
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayAttackAnimation();
|
||||
}
|
||||
if (PlayerIsHittingGeometry())
|
||||
{
|
||||
AnimationPlayer.Play("hit_wall");
|
||||
}
|
||||
else
|
||||
{
|
||||
PlayAttackAnimation();
|
||||
}
|
||||
}
|
||||
|
||||
private void ThrowItem()
|
||||
{
|
||||
var itemScene = GD.Load<PackedScene>("res://src/items/throwable/ThrowableItem.tscn");
|
||||
var throwItem = itemScene.Instantiate<ThrowableItem>();
|
||||
GetTree().Root.AddChildEx(throwItem);
|
||||
throwItem.GlobalPosition = CurrentPosition + new Vector3(0, 3.5f, 0);
|
||||
throwItem.GlobalRotation = GlobalRotation;
|
||||
var itemScene = GD.Load<PackedScene>("res://src/items/throwable/ThrowableItem.tscn");
|
||||
var throwItem = itemScene.Instantiate<ThrowableItem>();
|
||||
GetTree().Root.AddChildEx(throwItem);
|
||||
throwItem.GlobalPosition = CurrentPosition + new Vector3(0, 3.5f, 0);
|
||||
throwItem.GlobalRotation = GlobalRotation;
|
||||
}
|
||||
|
||||
private void PlayAttackAnimation()
|
||||
{
|
||||
var attackSpeed = ((Weapon)EquipmentComponent.EquippedWeapon.Value).AttackSpeed;
|
||||
AnimationPlayer.SetSpeedScale((float)attackSpeed);
|
||||
AnimationPlayer.Play("attack");
|
||||
var attackSpeed = ((Weapon)EquipmentComponent.EquippedWeapon.Value).AttackSpeed;
|
||||
AnimationPlayer.SetSpeedScale((float)attackSpeed);
|
||||
AnimationPlayer.Play("attack");
|
||||
}
|
||||
|
||||
private void OnExitTree()
|
||||
{
|
||||
PlayerLogic.Stop();
|
||||
PlayerBinding.Dispose();
|
||||
Hitbox.AreaEntered -= Hitbox_AreaEntered;
|
||||
CollisionDetector.AreaEntered -= CollisionDetector_AreaEntered;
|
||||
HealthComponent.HealthReachedZero -= Die;
|
||||
HealthTimer.Timeout -= OnHealthTimerTimeout;
|
||||
PlayerLogic.Stop();
|
||||
PlayerBinding.Dispose();
|
||||
Hitbox.AreaEntered -= Hitbox_AreaEntered;
|
||||
CollisionDetector.AreaEntered -= CollisionDetector_AreaEntered;
|
||||
HealthComponent.HealthReachedZero -= Die;
|
||||
HealthTimer.Timeout -= OnHealthTimerTimeout;
|
||||
}
|
||||
|
||||
private void Move(float delta)
|
||||
{
|
||||
var rawInput = GlobalInputVector;
|
||||
var strafeLeftInput = LeftStrafeInputVector;
|
||||
var strafeRightInput = RightStrafeInputVector;
|
||||
var rawInput = GlobalInputVector;
|
||||
var strafeLeftInput = LeftStrafeInputVector;
|
||||
var strafeRightInput = RightStrafeInputVector;
|
||||
|
||||
var transform = Transform;
|
||||
transform.Basis = new Basis(Vector3.Up, Settings.RotationSpeed * -rawInput.X * delta) * transform.Basis;
|
||||
var moveDirection = new Vector3(strafeRightInput - strafeLeftInput, 0, rawInput.Z).Normalized();
|
||||
var velocity = Basis * moveDirection * Settings.MoveSpeed * Settings.Acceleration;
|
||||
_knockbackStrength *= 0.9f;
|
||||
Transform = Transform with { Basis = transform.Basis };
|
||||
Velocity = velocity + (_knockbackDirection * _knockbackStrength);
|
||||
MoveAndSlide();
|
||||
var transform = Transform;
|
||||
transform.Basis = new Basis(Vector3.Up, Settings.RotationSpeed * -rawInput.X * delta) * transform.Basis;
|
||||
var moveDirection = new Vector3(strafeRightInput - strafeLeftInput, 0, rawInput.Z).Normalized();
|
||||
var velocity = Basis * moveDirection * Settings.MoveSpeed * Settings.Acceleration;
|
||||
_knockbackStrength *= 0.9f;
|
||||
Transform = Transform with { Basis = transform.Basis };
|
||||
Velocity = velocity + (_knockbackDirection * _knockbackStrength);
|
||||
MoveAndSlide();
|
||||
}
|
||||
|
||||
private void OnPlayerPositionUpdated(Vector3 globalPosition) => GlobalPosition = globalPosition;
|
||||
|
||||
private void OnHealthTimerTimeout()
|
||||
{
|
||||
if (VTComponent.CurrentVT.Value > 0)
|
||||
{
|
||||
if (((Accessory)EquipmentComponent.EquippedAccessory.Value).AccessoryTag == AccessoryTag.HalfVTConsumption)
|
||||
reduceOnTick = !reduceOnTick;
|
||||
if (VTComponent.CurrentVT.Value > 0)
|
||||
{
|
||||
if (((Accessory)EquipmentComponent.EquippedAccessory.Value).AccessoryTag == AccessoryTag.HalfVTConsumption)
|
||||
reduceOnTick = !reduceOnTick;
|
||||
|
||||
HealthComponent.Heal(1);
|
||||
HealthComponent.Heal(1);
|
||||
|
||||
if (reduceOnTick)
|
||||
VTComponent.Reduce(1);
|
||||
}
|
||||
else
|
||||
HealthComponent.Damage(1);
|
||||
if (reduceOnTick)
|
||||
VTComponent.Reduce(1);
|
||||
}
|
||||
else
|
||||
HealthComponent.Damage(1);
|
||||
}
|
||||
|
||||
private void Hitbox_AreaEntered(Area3D area)
|
||||
{
|
||||
var target = area.GetOwner();
|
||||
if (target is IEnemy enemy)
|
||||
HitEnemy(enemy);
|
||||
var target = area.GetOwner();
|
||||
if (target is IEnemy enemy)
|
||||
HitEnemy(enemy);
|
||||
}
|
||||
|
||||
private void HitEnemy(IEnemy enemy)
|
||||
{
|
||||
var ignoreElementalResistance = (EquipmentComponent.EquippedWeapon.Value as Weapon).WeaponTag == WeaponTag.IgnoreAffinity;
|
||||
var ignoreDefense = (EquipmentComponent.EquippedWeapon.Value as Weapon).WeaponTag == WeaponTag.IgnoreDefense;
|
||||
var isCriticalHit = BattleExtensions.IsCriticalHit(LuckComponent.Luck.Value + EquipmentComponent.BonusLuck);
|
||||
var totalDamage = AttackComponent.CurrentAttack.Value + EquipmentComponent.BonusAttack;
|
||||
var element = (EquipmentComponent.EquippedWeapon.Value as Weapon).WeaponElement;
|
||||
var ignoreElementalResistance = (EquipmentComponent.EquippedWeapon.Value as Weapon).WeaponTag == WeaponTag.IgnoreAffinity;
|
||||
var ignoreDefense = (EquipmentComponent.EquippedWeapon.Value as Weapon).WeaponTag == WeaponTag.IgnoreDefense;
|
||||
var isCriticalHit = BattleExtensions.IsCriticalHit(LuckComponent.Luck.Value + EquipmentComponent.BonusLuck);
|
||||
var totalDamage = AttackComponent.CurrentAttack.Value + EquipmentComponent.BonusAttack;
|
||||
var element = (EquipmentComponent.EquippedWeapon.Value as Weapon).WeaponElement;
|
||||
|
||||
if (isCriticalHit)
|
||||
totalDamage += (int)(totalDamage * 0.5f);
|
||||
if (isCriticalHit)
|
||||
totalDamage += (int)(totalDamage * 0.5f);
|
||||
|
||||
var baseAttack = new AttackData(totalDamage, element, ignoreDefense, ignoreElementalResistance);
|
||||
var damageDealt = DamageCalculator.CalculateDamage(baseAttack, enemy.DefenseComponent.CurrentDefense.Value, ElementalResistanceSet.None);
|
||||
enemy.HealthComponent.Damage(damageDealt);
|
||||
var baseAttack = new AttackData(totalDamage, element, ignoreDefense, ignoreElementalResistance);
|
||||
var damageDealt = DamageCalculator.CalculateDamage(baseAttack, enemy.DefenseComponent.CurrentDefense.Value, ElementalResistanceSet.None);
|
||||
enemy.HealthComponent.Damage(damageDealt);
|
||||
|
||||
if (((Weapon)EquipmentComponent.EquippedWeapon.Value).WeaponTag == WeaponTag.Knockback && enemy is IKnockbackable knockbackable)
|
||||
knockbackable.Knockback(0.3f, -CurrentBasis.Z.Normalized());
|
||||
if (((Weapon)EquipmentComponent.EquippedWeapon.Value).WeaponTag == WeaponTag.SelfDamage)
|
||||
HealthComponent.Damage(5);
|
||||
if (((Weapon)EquipmentComponent.EquippedWeapon.Value).WeaponTag == WeaponTag.Knockback && enemy is IKnockbackable knockbackable)
|
||||
knockbackable.Knockback(0.3f, -CurrentBasis.Z.Normalized());
|
||||
if (((Weapon)EquipmentComponent.EquippedWeapon.Value).WeaponTag == WeaponTag.SelfDamage)
|
||||
HealthComponent.Damage(5);
|
||||
}
|
||||
|
||||
private void CollisionDetector_AreaEntered(Area3D area)
|
||||
{
|
||||
if (area.GetParent() is InventoryItem inventoryItem)
|
||||
{
|
||||
var isAdded = Inventory.PickUpItem(inventoryItem);
|
||||
if (isAdded)
|
||||
inventoryItem.QueueFree();
|
||||
}
|
||||
if (area.GetParent() is DroppedItem droppedItem)
|
||||
{
|
||||
var isAdded = Inventory.PickUpItem(droppedItem.Item);
|
||||
if (isAdded)
|
||||
droppedItem.QueueFree();
|
||||
}
|
||||
if (area.GetParent() is ThrownItem thrownItem)
|
||||
{
|
||||
var isAdded = Inventory.PickUpItem(thrownItem.ItemThatIsThrown);
|
||||
if (isAdded)
|
||||
thrownItem.QueueFree();
|
||||
}
|
||||
if (area.GetParent() is Restorative restorative)
|
||||
{
|
||||
//_gameRepo.OnRestorativePickedUp(restorative);
|
||||
restorative.QueueFree();
|
||||
}
|
||||
if (area.GetParent() is InventoryItem inventoryItem)
|
||||
{
|
||||
var isAdded = Inventory.PickUpItem(inventoryItem);
|
||||
if (isAdded)
|
||||
inventoryItem.QueueFree();
|
||||
}
|
||||
if (area.GetParent() is DroppedItem droppedItem)
|
||||
{
|
||||
var isAdded = Inventory.PickUpItem(droppedItem.Item);
|
||||
if (isAdded)
|
||||
droppedItem.QueueFree();
|
||||
}
|
||||
if (area.GetParent() is ThrownItem thrownItem)
|
||||
{
|
||||
var isAdded = Inventory.PickUpItem(thrownItem.ItemThatIsThrown);
|
||||
if (isAdded)
|
||||
thrownItem.QueueFree();
|
||||
}
|
||||
if (area.GetParent() is Restorative restorative)
|
||||
{
|
||||
//_gameRepo.OnRestorativePickedUp(restorative);
|
||||
restorative.QueueFree();
|
||||
}
|
||||
}
|
||||
|
||||
private bool PlayerIsHittingGeometry()
|
||||
{
|
||||
var collisions = WallCheck.GetCollidingBodies();
|
||||
return collisions.Count > 0;
|
||||
var collisions = WallCheck.GetCollidingBodies();
|
||||
return collisions.Count > 0;
|
||||
}
|
||||
|
||||
private void WallCheck_BodyEntered(Node body)
|
||||
{
|
||||
GD.Print("Hit wall");
|
||||
AnimationPlayer.Stop();
|
||||
GD.Print("Hit wall");
|
||||
AnimationPlayer.Stop();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
[gd_scene load_steps=45 format=3 uid="uid://cfecvvav8kkp6"]
|
||||
[gd_scene load_steps=48 format=3 uid="uid://cfecvvav8kkp6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://yxmiqy7i0t7r" path="res://src/player/Player.cs" id="1_xcol5"]
|
||||
[ext_resource type="Texture2D" uid="uid://c4ps26w7h3vpq" path="res://src/minimap/textures/player_map_icon.png" id="4_3ojaj"]
|
||||
[ext_resource type="Texture2D" uid="uid://c6r3dhnkuw22w" path="res://src/vfx/hit_effects/FIRE_STRIKE_1.0.png" id="5_wr6lo"]
|
||||
[ext_resource type="Texture2D" uid="uid://b5qjlbcesth53" path="res://src/vfx/Weapon Strikes/NON ELEMENTAL SLASH.png" id="6_p34sl"]
|
||||
[ext_resource type="Texture2D" uid="uid://mjobx7ph7hf1" path="res://src/vfx/playerdot.png" id="7_8hi2n"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_dw45s"]
|
||||
radius = 1.0
|
||||
@@ -331,6 +331,34 @@ animations = [{
|
||||
"speed": 12.0
|
||||
}]
|
||||
|
||||
[sub_resource type="Animation" id="Animation_3ojaj"]
|
||||
resource_name = "IconAnimation"
|
||||
length = 2.5
|
||||
loop_mode = 1
|
||||
tracks/0/type = "scale_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Minimap/Minimap Sprite")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 2.4, 2.4, 2.4, 1.23333, 1, 2.7, 2.7, 2.7, 2.5, 1, 2.4, 2.4, 2.4)
|
||||
|
||||
[sub_resource type="Animation" id="Animation_565yv"]
|
||||
length = 0.001
|
||||
tracks/0/type = "scale_3d"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Minimap/Minimap Sprite")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = PackedFloat32Array(0, 1, 2.4, 2.4, 2.4)
|
||||
|
||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_v7rlw"]
|
||||
_data = {
|
||||
&"IconAnimation": SubResource("Animation_3ojaj"),
|
||||
&"RESET": SubResource("Animation_565yv")
|
||||
}
|
||||
|
||||
[sub_resource type="BoxShape3D" id="BoxShape3D_wedu3"]
|
||||
size = Vector3(1, 1, 1.80176)
|
||||
|
||||
@@ -376,10 +404,11 @@ flip_v = true
|
||||
[node name="Camera" type="Node3D" parent="."]
|
||||
|
||||
[node name="Camera3D" type="Camera3D" parent="Camera"]
|
||||
transform = Transform3D(1, 6.69803e-05, 0.000118449, -6.06525e-05, 0.998614, -0.052638, -0.000121811, 0.052638, 0.998614, 0.003, 1.4, -0.0095706)
|
||||
transform = Transform3D(1, 6.69803e-05, 0.000118449, -6.06525e-05, 0.998614, -0.052638, -0.000121811, 0.052638, 0.998614, 0.003, 1.2, -0.01)
|
||||
cull_mask = 1048569
|
||||
doppler_tracking = 1
|
||||
fov = 52.0
|
||||
near = 0.01
|
||||
far = 9000.0
|
||||
|
||||
[node name="player_model" type="Node3D" parent="Camera"]
|
||||
@@ -389,22 +418,34 @@ transform = Transform3D(-0.015, 0, -2.26494e-09, 0, 0.015, 0, 2.26494e-09, 0, -0
|
||||
|
||||
[node name="OmniLight3D" type="OmniLight3D" parent="Camera/Lights"]
|
||||
transform = Transform3D(0.999997, 0, 0.00260054, 0, 1, 0, -0.00260054, 0, 0.999997, -0.109951, 1.37487, -0.0100155)
|
||||
visible = false
|
||||
light_color = Color(0.87424, 0.682579, 0.506014, 1)
|
||||
light_energy = 0.2
|
||||
light_bake_mode = 1
|
||||
shadow_enabled = true
|
||||
omni_range = 1.0
|
||||
omni_attenuation = 2.0
|
||||
shadow_opacity = 0.9
|
||||
shadow_blur = 2.038
|
||||
omni_range = 6.0
|
||||
omni_attenuation = 0.017
|
||||
|
||||
[node name="Minimap" type="Node3D" parent="."]
|
||||
|
||||
[node name="Minimap Sprite" type="Sprite3D" parent="Minimap"]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.265086, 0)
|
||||
transform = Transform3D(2.4, 0, 0, 0, 2.4, 0, 0, 0, 2.4, 0, 0.734914, -0.336784)
|
||||
layers = 2
|
||||
sorting_offset = 100.0
|
||||
pixel_size = 0.025
|
||||
axis = 1
|
||||
double_sided = false
|
||||
texture = ExtResource("7_8hi2n")
|
||||
texture_filter = 0
|
||||
render_priority = 127
|
||||
texture = ExtResource("4_3ojaj")
|
||||
|
||||
[node name="Minimap Icon Animation" type="AnimationPlayer" parent="Minimap"]
|
||||
root_node = NodePath("../..")
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_v7rlw")
|
||||
}
|
||||
autoplay = "IconAnimation"
|
||||
|
||||
[node name="Collision" type="Node3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.301443, 0)
|
||||
|
||||
Reference in New Issue
Block a user