Skip to content

Commit

Permalink
#6: Update with basic inventory/store UI to support local server mode…
Browse files Browse the repository at this point in the history
…. Still need to hook up inventory system for network sync within InventoryManager system
  • Loading branch information
Danil Ko committed Mar 1, 2021
1 parent 45a3503 commit 484129e
Show file tree
Hide file tree
Showing 35 changed files with 1,255 additions and 683 deletions.
12 changes: 6 additions & 6 deletions agents/AIAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ protected override void DisconnectWeapon(Weapon currentWeapon, Weapon.WeaponOrde
if (currentWeapon != null && _agentAI != null && IsInstanceValid(_agentAI))
{
// Deregister weapon with ai
if (currentWeapon.IsConnected(nameof(Weapon.AmmoOutSignal), _agentAI, "_on" + weaponOrder + "WeaponNeedReload"))
if (currentWeapon.IsConnected(nameof(Weapon.AmmoOutSignal), _agentAI, "_onWeaponReload"))
{
currentWeapon.Disconnect(nameof(Weapon.AmmoOutSignal), _agentAI, "_on" + weaponOrder + "WeaponNeedReload");
currentWeapon.Disconnect(nameof(Weapon.ReloadStopSignal), _agentAI, "_onRightWeaponReloadStop");
currentWeapon.Disconnect(nameof(Weapon.AmmoOutSignal), _agentAI, "_onWeaponReload");
currentWeapon.Disconnect(nameof(Weapon.ReloadSignal), _agentAI, "_onWeaponReload");
}
}
}
Expand All @@ -69,10 +69,10 @@ protected override void ConnectWeapon(Weapon currentWeapon, Weapon.WeaponOrder w
if (currentWeapon != null && _agentAI != null && IsInstanceValid(_agentAI))
{
// Register weapon with AI
if (!currentWeapon.IsConnected(nameof(Weapon.AmmoOutSignal), _agentAI, "_on" + weaponOrder + "WeaponNeedReload"))
if (!currentWeapon.IsConnected(nameof(Weapon.AmmoOutSignal), _agentAI, "_onWeaponReload"))
{
currentWeapon.Connect(nameof(Weapon.AmmoOutSignal), _agentAI, "_on" + weaponOrder + "WeaponNeedReload");
currentWeapon.Connect(nameof(Weapon.ReloadStopSignal), _agentAI, "_onRightWeaponReloadStop");
currentWeapon.Connect(nameof(Weapon.AmmoOutSignal), _agentAI, "_onWeaponReload");
currentWeapon.Connect(nameof(Weapon.ReloadSignal), _agentAI, "_onWeaponReload");
}

base.ConnectWeapon(currentWeapon, weaponOrder);
Expand Down
16 changes: 5 additions & 11 deletions agents/AIAgent.tscn
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
[gd_scene load_steps=6 format=2]
[gd_scene load_steps=5 format=2]

[ext_resource path="res://assets/allSprites_retina_rotated.png" type="Texture" id=1]
[ext_resource path="res://agents/Agent.tscn" type="PackedScene" id=2]
[ext_resource path="res://ai/AI.tscn" type="PackedScene" id=3]
[ext_resource path="res://agents/AIAgent.cs" type="Script" id=4]

[sub_resource type="RectangleShape2D" id=1]
extents = Vector2( 34.3803, 35.1768 )
extents = Vector2( 29.6973, 47.915 )

[node name="AIAgent" instance=ExtResource( 2 )]
collision_mask = 27
Expand All @@ -17,15 +16,10 @@ MaxHealth = 100
TurretSpeed = 10
DetectRadius = 1000.0

[node name="Body" parent="." index="0"]
texture = ExtResource( 1 )
region_enabled = true
region_rect = Rect2( 288, 103, 73, 79 )

[node name="CollisionShape2D" parent="." index="1"]
shape = SubResource( 1 )

[node name="PathLine" type="Line2D" parent="." index="7"]
default_color = Color( 0.952941, 0.235294, 0.0156863, 1 )

[node name="AI" parent="." index="8" instance=ExtResource( 3 )]

[node name="CollisionShape2D" parent="." index="12"]
shape = SubResource( 1 )

0 comments on commit 484129e

Please sign in to comment.