Add beginner's wand.
加入初学者法杖。
This commit is contained in:
parent
929dfb5f2f
commit
3695a7ef11
|
@ -19,3 +19,7 @@
|
||||||
scene_path: res://prefab/weapons/IronAxe.tscn
|
scene_path: res://prefab/weapons/IronAxe.tscn
|
||||||
icon_path: res://sprites/weapon/StaffNecromancy_Icon.png
|
icon_path: res://sprites/weapon/StaffNecromancy_Icon.png
|
||||||
max_stack_value: 1
|
max_stack_value: 1
|
||||||
|
- id: beginner_staff
|
||||||
|
scene_path: res://prefab/weapons/BeginnerStaff.tscn
|
||||||
|
icon_path: res://sprites/weapon/BeginnerStaff_Icon.png
|
||||||
|
max_stack_value: 1
|
|
@ -13,3 +13,5 @@ item_iron_axe,铁斧子,Iron axe,鉄の斧です
|
||||||
item_iron_axe_desc,铁斧子,Iron axe,鉄の斧です
|
item_iron_axe_desc,铁斧子,Iron axe,鉄の斧です
|
||||||
item_curse,死灵诅咒法术,The curse of the Dead,死霊呪いの術
|
item_curse,死灵诅咒法术,The curse of the Dead,死霊呪いの術
|
||||||
item_curse_desc,杀死敌人后在生成死灵敌人。,Spawn Undead enemies after killing them.,敵を殺すと死霊敵が発生します。
|
item_curse_desc,杀死敌人后在生成死灵敌人。,Spawn Undead enemies after killing them.,敵を殺すと死霊敵が発生します。
|
||||||
|
item_beginner_staff,初学者法杖,Beginner's staff,初心者用の杖です
|
||||||
|
item_beginner_staff_desc,送给初来乍到的冒险家。,For new adventurers.,初心者の冒険家に贈ります。
|
|
|
@ -33,6 +33,7 @@ radius = 172.29
|
||||||
collision_layer = 64
|
collision_layer = 64
|
||||||
collision_mask = 38
|
collision_mask = 38
|
||||||
script = ExtResource("1_ubaid")
|
script = ExtResource("1_ubaid")
|
||||||
|
InitWeaponId = "staff_necromancy"
|
||||||
CharacterName = "character_evil_crow"
|
CharacterName = "character_evil_crow"
|
||||||
CanMutateAfterDeath = false
|
CanMutateAfterDeath = false
|
||||||
MaxHp = 50
|
MaxHp = 50
|
||||||
|
|
|
@ -113,7 +113,7 @@ position = Vector2(134, 248)
|
||||||
script = ExtResource("4_6ihp7")
|
script = ExtResource("4_6ihp7")
|
||||||
_itemIdList = PackedStringArray("necromancy")
|
_itemIdList = PackedStringArray("necromancy")
|
||||||
|
|
||||||
[node name="staff_necromancy" type="Marker2D" parent="AutoSpawn"]
|
[node name="beginner_staff" type="Marker2D" parent="AutoSpawn"]
|
||||||
position = Vector2(100, 250)
|
position = Vector2(100, 250)
|
||||||
script = ExtResource("4_6ihp7")
|
script = ExtResource("4_6ihp7")
|
||||||
_itemIdList = PackedStringArray("staff_necromancy")
|
_itemIdList = PackedStringArray("beginner_staff")
|
||||||
|
|
51
prefab/weapons/BeginnerStaff.tscn
Normal file
51
prefab/weapons/BeginnerStaff.tscn
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
[gd_scene load_steps=7 format=3 uid="uid://cg2jmn7cs8m2c"]
|
||||||
|
|
||||||
|
[ext_resource type="Script" path="res://scripts/weapon/ProjectileWeapon.cs" id="1_w4b6p"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://pf2ilanjwino" path="res://sprites/weapon/BeginnerStaff_Icon.png" id="2_ip8xd"]
|
||||||
|
[ext_resource type="Texture2D" uid="uid://b4g1mkvjf7uns" path="res://sprites/weapon/BeginnerStaff.png" id="3_rhhwp"]
|
||||||
|
[ext_resource type="AudioStream" uid="uid://cak6chjjsu7wo" path="res://sounds/fire.wav" id="4_p12sk"]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_obcq2"]
|
||||||
|
size = Vector2(49, 5)
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_14m1g"]
|
||||||
|
size = Vector2(49, 5.25)
|
||||||
|
|
||||||
|
[node name="BeginnerStaff" type="RigidBody2D"]
|
||||||
|
collision_layer = 8
|
||||||
|
collision_mask = 34
|
||||||
|
script = ExtResource("1_w4b6p")
|
||||||
|
_numberSlots = 5
|
||||||
|
_fireSequentially = true
|
||||||
|
FiringIntervalAsMillisecond = 300
|
||||||
|
_recoilStrength = 5
|
||||||
|
UniqueIcon = ExtResource("2_ip8xd")
|
||||||
|
|
||||||
|
[node name="DamageArea2D" type="Area2D" parent="."]
|
||||||
|
collision_layer = 8
|
||||||
|
collision_mask = 102
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageArea2D"]
|
||||||
|
position = Vector2(25.5, 0.5)
|
||||||
|
shape = SubResource("RectangleShape2D_obcq2")
|
||||||
|
|
||||||
|
[node name="StaffOfTheUndead2" type="Sprite2D" parent="."]
|
||||||
|
position = Vector2(30, 0)
|
||||||
|
texture = ExtResource("3_rhhwp")
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2(25.5, 0.375)
|
||||||
|
shape = SubResource("RectangleShape2D_14m1g")
|
||||||
|
|
||||||
|
[node name="Marker2D" type="Marker2D" parent="."]
|
||||||
|
position = Vector2(65, 0)
|
||||||
|
|
||||||
|
[node name="AudioStreamPlayer2D" type="AudioStreamPlayer2D" parent="Marker2D"]
|
||||||
|
stream = ExtResource("4_p12sk")
|
||||||
|
bus = &"SoundEffect"
|
||||||
|
|
||||||
|
[node name="TipLabel" type="Label" parent="."]
|
||||||
|
offset_left = 6.0
|
||||||
|
offset_top = 48.0
|
||||||
|
offset_right = 46.0
|
||||||
|
offset_bottom = 73.0
|
|
@ -4,6 +4,33 @@
|
||||||
[ext_resource type="Script" path="res://scripts/map/miniMap/MiniMap.cs" id="2_ltp8b"]
|
[ext_resource type="Script" path="res://scripts/map/miniMap/MiniMap.cs" id="2_ltp8b"]
|
||||||
[ext_resource type="Texture2D" uid="uid://cfpcm0hkmpu38" path="res://sprites/ui/mark.png" id="3_x80y0"]
|
[ext_resource type="Texture2D" uid="uid://cfpcm0hkmpu38" path="res://sprites/ui/mark.png" id="3_x80y0"]
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_dkx17"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("Control/MiniMap:position")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Vector2(983, 480)]
|
||||||
|
}
|
||||||
|
tracks/1/type = "value"
|
||||||
|
tracks/1/imported = false
|
||||||
|
tracks/1/enabled = true
|
||||||
|
tracks/1/path = NodePath("Control/MiniMap:visible")
|
||||||
|
tracks/1/interp = 1
|
||||||
|
tracks/1/loop_wrap = true
|
||||||
|
tracks/1/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 1,
|
||||||
|
"values": [true]
|
||||||
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_jdj6o"]
|
[sub_resource type="Animation" id="Animation_jdj6o"]
|
||||||
resource_name = "hide"
|
resource_name = "hide"
|
||||||
length = 0.3
|
length = 0.3
|
||||||
|
@ -32,33 +59,6 @@ tracks/1/keys = {
|
||||||
"values": [true, false]
|
"values": [true, false]
|
||||||
}
|
}
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_dkx17"]
|
|
||||||
length = 0.001
|
|
||||||
tracks/0/type = "value"
|
|
||||||
tracks/0/imported = false
|
|
||||||
tracks/0/enabled = true
|
|
||||||
tracks/0/path = NodePath("Control/MiniMap:position")
|
|
||||||
tracks/0/interp = 1
|
|
||||||
tracks/0/loop_wrap = true
|
|
||||||
tracks/0/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 0,
|
|
||||||
"values": [Vector2(983, 480)]
|
|
||||||
}
|
|
||||||
tracks/1/type = "value"
|
|
||||||
tracks/1/imported = false
|
|
||||||
tracks/1/enabled = true
|
|
||||||
tracks/1/path = NodePath("Control/MiniMap:visible")
|
|
||||||
tracks/1/interp = 1
|
|
||||||
tracks/1/loop_wrap = true
|
|
||||||
tracks/1/keys = {
|
|
||||||
"times": PackedFloat32Array(0),
|
|
||||||
"transitions": PackedFloat32Array(1),
|
|
||||||
"update": 1,
|
|
||||||
"values": [true]
|
|
||||||
}
|
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_icaqa"]
|
[sub_resource type="Animation" id="Animation_icaqa"]
|
||||||
resource_name = "show"
|
resource_name = "show"
|
||||||
length = 0.3
|
length = 0.3
|
||||||
|
|
|
@ -106,10 +106,10 @@ public sealed partial class AiCharacter : CharacterTemplate
|
||||||
private BubbleMarker? _bubbleMarker;
|
private BubbleMarker? _bubbleMarker;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>The initial weapons scene</para>
|
/// <para>Initial weapon ID</para>
|
||||||
/// <para>初始的武器场景</para>
|
/// <para>初始的武器ID</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Export] public string? InitWeaponRes;
|
[Export] public string? InitWeaponId;
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
|
@ -184,30 +184,26 @@ public sealed partial class AiCharacter : CharacterTemplate
|
||||||
ProtectedItemContainer = universalItemContainer;
|
ProtectedItemContainer = universalItemContainer;
|
||||||
//Add initial weapon
|
//Add initial weapon
|
||||||
//添加初始武器
|
//添加初始武器
|
||||||
AddInitialWeapon(InitWeaponRes);
|
AddInitialWeapon(InitWeaponId);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// <para>Adds an initial weapon to the character</para>
|
/// <para>Adds an initial weapon to the character</para>
|
||||||
/// <para>为角色添加初始的武器</para>
|
/// <para>为角色添加初始的武器</para>
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private void AddInitialWeapon(string? initWeaponRes)
|
private void AddInitialWeapon(string? initWeaponId)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(initWeaponRes))
|
if (string.IsNullOrEmpty(initWeaponId))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set the resource path of the initial weapon and try to create the object of the initial weapon.
|
var item = ItemTypeManager.CreateItem(initWeaponId, this);
|
||||||
//设置了初始武器的资源路径,尝试创建初始武器的对象。
|
if (item is not WeaponTemplate weaponTemplate)
|
||||||
var packedScene = ResourceLoader.Load<PackedScene>(initWeaponRes);
|
|
||||||
var weaponTemplate = NodeUtils.InstantiatePackedScene<WeaponTemplate>(packedScene);
|
|
||||||
if (weaponTemplate == null)
|
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
NodeUtils.CallDeferredReparent(this, weaponTemplate);
|
||||||
NodeUtils.CallDeferredAddChild(this, weaponTemplate);
|
|
||||||
PickItem(weaponTemplate);
|
PickItem(weaponTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
BIN
sprites/weapon/BeginnerStaff.png
Normal file
BIN
sprites/weapon/BeginnerStaff.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 732 B |
34
sprites/weapon/BeginnerStaff.png.import
Normal file
34
sprites/weapon/BeginnerStaff.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://b4g1mkvjf7uns"
|
||||||
|
path="res://.godot/imported/BeginnerStaff.png-b812f1377a68497cf5d497a50a7dc4eb.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://sprites/weapon/BeginnerStaff.png"
|
||||||
|
dest_files=["res://.godot/imported/BeginnerStaff.png-b812f1377a68497cf5d497a50a7dc4eb.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
34
sprites/weapon/BeginnerStaffIcon.png.import
Normal file
34
sprites/weapon/BeginnerStaffIcon.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://r2obk433du1r"
|
||||||
|
path="res://.godot/imported/BeginnerStaffIcon.png-e12838ace0d9a63d4c717c73ff599a24.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://sprites/weapon/BeginnerStaffIcon.png"
|
||||||
|
dest_files=["res://.godot/imported/BeginnerStaffIcon.png-e12838ace0d9a63d4c717c73ff599a24.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
BIN
sprites/weapon/BeginnerStaff_Icon.png
Normal file
BIN
sprites/weapon/BeginnerStaff_Icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 874 B |
34
sprites/weapon/BeginnerStaff_Icon.png.import
Normal file
34
sprites/weapon/BeginnerStaff_Icon.png.import
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://pf2ilanjwino"
|
||||||
|
path="res://.godot/imported/BeginnerStaff_Icon.png-5f3c025d334f338333d0f48cf2e52c0e.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://sprites/weapon/BeginnerStaff_Icon.png"
|
||||||
|
dest_files=["res://.godot/imported/BeginnerStaff_Icon.png-5f3c025d334f338333d0f48cf2e52c0e.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
Loading…
Reference in New Issue
Block a user