Dialogue system; ask user if they want to teleport to next floor
This commit is contained in:
@@ -1,26 +1,46 @@
|
||||
using Chickensoft.AutoInject;
|
||||
using Chickensoft.GodotNodeInterfaces;
|
||||
using Chickensoft.Introspection;
|
||||
using GameJamDungeon;
|
||||
using Godot;
|
||||
|
||||
public interface IThrowableItem : INode3D
|
||||
{
|
||||
public IAnimationPlayer AnimationPlayer { get; set; }
|
||||
}
|
||||
using System.Linq;
|
||||
|
||||
[Meta(typeof(IAutoNode))]
|
||||
public partial class ThrowableItem : Node3D, IThrowableItem
|
||||
public partial class ThrowableItem : Node3D, IInventoryItem
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Dependency] public IGameRepo GameRepo => this.DependOn<IGameRepo>();
|
||||
|
||||
[Node] public IAnimationPlayer AnimationPlayer { get; set; } = default!;
|
||||
|
||||
[Node] public IHitbox Hitbox { get; set; } = default!;
|
||||
|
||||
public void Setup()
|
||||
public InventoryItemInfo Info => ThrowableItemInfo;
|
||||
|
||||
[Export]
|
||||
public ThrowableItemInfo ThrowableItemInfo { get; set; }
|
||||
|
||||
[Node] public Sprite3D Sprite { get; set; } = default!;
|
||||
|
||||
[Node] public Area3D Pickup { get; set; } = default!;
|
||||
|
||||
public void OnReady()
|
||||
{
|
||||
AnimationPlayer.AnimationFinished += OnAnimationFinished;
|
||||
Hitbox.Damage = 5;
|
||||
Sprite.Texture = ThrowableItemInfo.Texture;
|
||||
Pickup.BodyEntered += OnEntered;
|
||||
}
|
||||
|
||||
public void OnEntered(Node3D body)
|
||||
{
|
||||
if (GameRepo.InventoryItems.Value.Count() >= GameRepo.MaxItemSize)
|
||||
return;
|
||||
|
||||
var inventoryList = GameRepo.InventoryItems.Value.Append(this).ToList();
|
||||
GameRepo.InventoryItems.OnNext(inventoryList);
|
||||
QueueFree();
|
||||
}
|
||||
|
||||
private void OnAnimationFinished(StringName animName)
|
||||
@@ -28,30 +48,3 @@ public partial class ThrowableItem : Node3D, IThrowableItem
|
||||
QueueFree();
|
||||
}
|
||||
}
|
||||
|
||||
public enum ThrowableItemTag
|
||||
{
|
||||
InflictTelluricDamage,
|
||||
InflictAeolicDamage,
|
||||
InflictHydricDamage,
|
||||
InflictIgneousDamage,
|
||||
InflictFerrumDamage,
|
||||
DoubleEXP,
|
||||
RandomWarp,
|
||||
LowerTargetTo1HP,
|
||||
IdentifyAllItemsCostHP,
|
||||
WarpToExitIfFound,
|
||||
RandomNewItem,
|
||||
BasicItem,
|
||||
SwapHPandVTWithEntitiesInRoom,
|
||||
TeleportAllEnemiesToRoom,
|
||||
TurnAllEnemiesIntoHealingItem,
|
||||
KillHalfEnemiesInRoom,
|
||||
AbsorbHPFromAllEnemiesInRoom,
|
||||
HealsAllInRoomToMaxHP,
|
||||
RandomEffect,
|
||||
Add1ATK,
|
||||
Add1DEF,
|
||||
RaiseLevelBy1,
|
||||
BriefImmunity
|
||||
}
|
||||
Reference in New Issue
Block a user