Item spawning
This commit is contained in:
@@ -9,23 +9,19 @@ public partial class Weapon : InventoryItem
|
||||
{
|
||||
public Weapon()
|
||||
{
|
||||
Info = new WeaponInfo() { Damage = 1 };
|
||||
WeaponInfo = new WeaponInfo() { Damage = 1, WeaponTags = new Godot.Collections.Array<WeaponTag>(), Texture = new Texture2D() };
|
||||
}
|
||||
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
public new InventoryItemInfo Info => WeaponInfo;
|
||||
|
||||
[Export]
|
||||
internal override InventoryItemInfo Info { get; set; }
|
||||
|
||||
[Node]
|
||||
public RigidBody3D Rigid { get; set; } = default!;
|
||||
|
||||
public WeaponInfo WeaponInfo { get => (WeaponInfo)Info; }
|
||||
|
||||
private Vector3 _targetPosition = Vector3.Zero;
|
||||
public WeaponInfo WeaponInfo { get; set; }
|
||||
|
||||
public void OnReady()
|
||||
{
|
||||
Sprite.Texture = WeaponInfo.Texture;
|
||||
Pickup.BodyEntered += OnEntered;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://cgwtjleqvgubc"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://db206brufi83s"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/items/weapons/Weapon.cs" id="1_7pkyf"]
|
||||
[ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="2_bwl3y"]
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_wll7p"]
|
||||
radius = 0.470016
|
||||
@@ -90,7 +89,7 @@ _data = {
|
||||
"drop": SubResource("Animation_gkdye")
|
||||
}
|
||||
|
||||
[node name="SealingRod" type="Node3D"]
|
||||
[node name="Weapon" type="Node3D"]
|
||||
script = ExtResource("1_7pkyf")
|
||||
|
||||
[node name="Pickup" type="Area3D" parent="."]
|
||||
@@ -108,7 +107,6 @@ alpha_cut = 1
|
||||
alpha_scissor_threshold = 0.511
|
||||
alpha_antialiasing_mode = 1
|
||||
texture_filter = 0
|
||||
texture = ExtResource("2_bwl3y")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"]
|
||||
shape = SubResource("CapsuleShape3D_wll7p")
|
||||
@@ -4,8 +4,14 @@ using Godot;
|
||||
[GlobalClass]
|
||||
public partial class WeaponInfo : InventoryItemInfo
|
||||
{
|
||||
public WeaponInfo()
|
||||
{
|
||||
Damage = 1;
|
||||
WeaponTags = new Godot.Collections.Array<WeaponTag>();
|
||||
}
|
||||
|
||||
[Export]
|
||||
public required int Damage { get; set; }
|
||||
public int Damage { get; set; }
|
||||
|
||||
[Export]
|
||||
public double Luck { get; set; } = 0.05;
|
||||
@@ -29,5 +35,5 @@ public partial class WeaponInfo : InventoryItemInfo
|
||||
public double FerrumDamageBonus { get; set; }
|
||||
|
||||
[Export]
|
||||
public Godot.Collections.Array<WeaponTag> WeaponTags { get; set; }
|
||||
public Godot.Collections.Array<WeaponTag> WeaponTags { get; set; } = new Godot.Collections.Array<WeaponTag>();
|
||||
}
|
||||
|
||||
@@ -1,15 +1,30 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://c10nhqq8su6pp"]
|
||||
[gd_scene load_steps=9 format=3 uid="uid://c10nhqq8su6pp"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/items/weapons/Weapon.cs" id="1_f8v7v"]
|
||||
[ext_resource type="Resource" uid="uid://b4oxsf4k3nr43" path="res://src/items/weapons/resources/RareSword.tres" id="2_6nmyd"]
|
||||
[ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="3_meaac"]
|
||||
[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="3_o6dnw"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_s6hhf"]
|
||||
script = ExtResource("3_o6dnw")
|
||||
Damage = 7
|
||||
Luck = 0.05
|
||||
AttackSpeed = 1.0
|
||||
TelluricDamageBonus = 0.0
|
||||
AeolicDamageBonus = 0.0
|
||||
BaseHydricDamageBonus = 0.0
|
||||
IgneousDamageBonus = 0.0
|
||||
FerrumDamageBonus = 0.0
|
||||
WeaponTags = []
|
||||
Name = ""
|
||||
Description = ""
|
||||
Texture = ExtResource("3_meaac")
|
||||
|
||||
[sub_resource type="Animation" id="Animation_w4iur"]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Rigid/Pickup:position")
|
||||
tracks/0/path = NodePath("Pickup:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
@@ -25,7 +40,7 @@ length = 0.75
|
||||
tracks/0/type = "value"
|
||||
tracks/0/imported = false
|
||||
tracks/0/enabled = true
|
||||
tracks/0/path = NodePath("Rigid/Pickup:position")
|
||||
tracks/0/path = NodePath("Pickup:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/keys = {
|
||||
@@ -41,19 +56,12 @@ _data = {
|
||||
"drop": SubResource("Animation_gkdye")
|
||||
}
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_n11ob"]
|
||||
rough = true
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_uhvnd"]
|
||||
radius = 0.4
|
||||
height = 1.4
|
||||
|
||||
[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_4ic28"]
|
||||
radius = 0.470016
|
||||
|
||||
[node name="RareSword" type="Node3D"]
|
||||
script = ExtResource("1_f8v7v")
|
||||
Info = ExtResource("2_6nmyd")
|
||||
WeaponInfo = SubResource("Resource_s6hhf")
|
||||
|
||||
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
@@ -61,23 +69,12 @@ libraries = {
|
||||
"": SubResource("AnimationLibrary_s2htf")
|
||||
}
|
||||
|
||||
[node name="Rigid" type="RigidBody3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -4)
|
||||
mass = 50.0
|
||||
physics_material_override = SubResource("PhysicsMaterial_n11ob")
|
||||
sleeping = true
|
||||
lock_rotation = true
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Rigid"]
|
||||
shape = SubResource("CapsuleShape3D_uhvnd")
|
||||
|
||||
[node name="Pickup" type="Area3D" parent="Rigid"]
|
||||
[node name="Pickup" type="Area3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
collision_layer = 4
|
||||
collision_mask = 4
|
||||
|
||||
[node name="Sprite" type="Sprite3D" parent="Rigid/Pickup"]
|
||||
[node name="Sprite" type="Sprite3D" parent="Pickup"]
|
||||
unique_name_in_owner = true
|
||||
billboard = 2
|
||||
double_sided = false
|
||||
@@ -87,5 +84,5 @@ alpha_antialiasing_mode = 1
|
||||
texture_filter = 0
|
||||
texture = ExtResource("3_meaac")
|
||||
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Rigid/Pickup"]
|
||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Pickup"]
|
||||
shape = SubResource("CapsuleShape3D_4ic28")
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://lnrykoy5ngpe"]
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://c1bg0o7nmu2xw"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="1_4hugd"]
|
||||
[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_re512"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_re512")
|
||||
Damage = 5
|
||||
Damage = 0
|
||||
Luck = 0.05
|
||||
AttackSpeed = 1.0
|
||||
TelluricDamageBonus = 0.0
|
||||
@@ -14,4 +15,5 @@ IgneousDamageBonus = 0.0
|
||||
FerrumDamageBonus = 0.0
|
||||
WeaponTags = Array[int]([])
|
||||
Name = "Jiblett"
|
||||
Description = "A halberd for the tasteful."
|
||||
Description = ""
|
||||
Texture = ExtResource("1_4hugd")
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://cbnfxh66h4kix"]
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://db075qhmlmrcu"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="1_35u6c"]
|
||||
[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_kbje7"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_kbje7")
|
||||
Damage = 11
|
||||
Damage = 0
|
||||
Luck = 0.05
|
||||
AttackSpeed = 1.0
|
||||
TelluricDamageBonus = 0.0
|
||||
@@ -12,6 +13,7 @@ AeolicDamageBonus = 0.0
|
||||
BaseHydricDamageBonus = 0.0
|
||||
IgneousDamageBonus = 0.0
|
||||
FerrumDamageBonus = 0.0
|
||||
WeaponTags = Array[int]([1])
|
||||
WeaponTags = Array[int]([])
|
||||
Name = "Kubel"
|
||||
Description = "A very powerful spear. For every hit, you lose 5 HP."
|
||||
Description = ""
|
||||
Texture = ExtResource("1_35u6c")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://bpqq1skryv1cp"]
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://cfr100khjkloh"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="1_rcmir"]
|
||||
[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_vroib"]
|
||||
|
||||
[resource]
|
||||
@@ -15,3 +16,4 @@ FerrumDamageBonus = 0.0
|
||||
WeaponTags = Array[int]([])
|
||||
Name = "Love Judgement"
|
||||
Description = "A mace only wieldable by the strong of heart."
|
||||
Texture = ExtResource("1_rcmir")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://gkxm3nwxbc3b"]
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://ckj1m4iv4m02r"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="1_ccrtk"]
|
||||
[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_pwwg7"]
|
||||
|
||||
[resource]
|
||||
@@ -15,3 +16,4 @@ FerrumDamageBonus = 0.0
|
||||
WeaponTags = Array[int]([3])
|
||||
Name = "Palm of Heaven"
|
||||
Description = "Very Powerful. Breaks upon leaving the floor."
|
||||
Texture = ExtResource("1_ccrtk")
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://b4oxsf4k3nr43"]
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://b4oxsf4k3nr43"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_oqgv2"]
|
||||
[ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="1_rlq8c"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_oqgv2")
|
||||
Damage = 7
|
||||
Luck = 0.85
|
||||
AttackSpeed = 1.5
|
||||
Luck = 0.05
|
||||
AttackSpeed = 1.0
|
||||
TelluricDamageBonus = 0.0
|
||||
AeolicDamageBonus = 0.0
|
||||
BaseHydricDamageBonus = 0.0
|
||||
@@ -15,3 +16,4 @@ FerrumDamageBonus = 0.0
|
||||
WeaponTags = Array[int]([])
|
||||
Name = "Rare sword"
|
||||
Description = "Rare"
|
||||
Texture = ExtResource("1_rlq8c")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://nxt3updvfbke"]
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://gebgo2x6nr3t"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="1_3aw6j"]
|
||||
[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_xfb0x"]
|
||||
|
||||
[resource]
|
||||
@@ -15,3 +16,4 @@ FerrumDamageBonus = 0.0
|
||||
WeaponTags = Array[int]([1])
|
||||
Name = "Rondo"
|
||||
Description = "An eastern blade outside of time and reproach."
|
||||
Texture = ExtResource("1_3aw6j")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://cgbbc4mavlwn1"]
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://b7xr0l4a8g1gk"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="1_8htja"]
|
||||
[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_40b5j"]
|
||||
|
||||
[resource]
|
||||
@@ -13,6 +14,7 @@ BaseHydricDamageBonus = 0.0
|
||||
IgneousDamageBonus = 0.0
|
||||
FerrumDamageBonus = 0.0
|
||||
WeaponTags = Array[int]([])
|
||||
Texture = ExtResource("1_8htja")
|
||||
Name = "Sealing Rod"
|
||||
Description = "A wand fitted with charms said to cleanse and purify that which belongs to other worlds.
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=2 format=3 uid="uid://cbc3o11perlvm"]
|
||||
[gd_resource type="Resource" script_class="WeaponInfo" load_steps=3 format=3 uid="uid://bpdbuf0k0exb5"]
|
||||
|
||||
[ext_resource type="Script" path="res://src/items/weapons/WeaponInfo.cs" id="1_cik6n"]
|
||||
[ext_resource type="Texture2D" uid="uid://wd6jh5q51e4k" path="res://src/items/weapons/models/sword.png" id="1_qxt4y"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("1_cik6n")
|
||||
@@ -17,3 +18,4 @@ Name = "Swan Sword Odette"
|
||||
Description = "Ignores Affinity.
|
||||
|
||||
The blade of a thousand faced heroine."
|
||||
Texture = ExtResource("1_qxt4y")
|
||||
|
||||
Reference in New Issue
Block a user