mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat: 添加矢量星武器和子弹功能
实现新的矢量星武器系统,包括武器卡片、子弹行为和粒子效果。主要功能包括: - 添加VectorStarWeapon.gd武器脚本,支持多子弹发射和追踪目标 - 实现VectorStar.gd子弹脚本,包含初始冲刺和后续追踪逻辑 - 添加相关场景资源和配置 - 将新武器添加到公鸡角色的武器库中
This commit is contained in:
@@ -53,7 +53,7 @@ tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/keys = {
|
||||
"handle_modes": PackedInt32Array(0, 0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, -500, -0.25, 0, 0.25, 0),
|
||||
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 500, -0.25, 0, 0.25, 0),
|
||||
"times": PackedFloat32Array(0, 0.5)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://ro1df12asa6y"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://ro1df12asa6y"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://crtdkysmnkith" path="res://components/Abstracts/BulletBase.tscn" id="1_fyvdf"]
|
||||
[ext_resource type="Script" path="res://scripts/Contents/Bullets/VectorStar.gd" id="2_1u5ed"]
|
||||
[ext_resource type="Texture2D" uid="uid://d2pndtow16635" path="res://resources/bullets/lgbt-bullet/造型2.svg" id="2_7b7fr"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_jj20o"]
|
||||
@@ -15,7 +16,7 @@ animations = [{
|
||||
}]
|
||||
|
||||
[sub_resource type="Curve" id="Curve_y5wc0"]
|
||||
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||
_data = [Vector2(0, 0.5), 0.0, 0.0, 0, 0, Vector2(1, 0), 0.0, 0.0, 0, 0]
|
||||
point_count = 2
|
||||
|
||||
[sub_resource type="CurveTexture" id="CurveTexture_c22if"]
|
||||
@@ -32,17 +33,23 @@ curve = SubResource("Curve_r5tug")
|
||||
particle_flag_disable_z = true
|
||||
direction = Vector3(-1, 0, 0)
|
||||
spread = 0.0
|
||||
initial_velocity_min = 50.0
|
||||
initial_velocity_max = 100.0
|
||||
initial_velocity_min = 100.0
|
||||
initial_velocity_max = 200.0
|
||||
gravity = Vector3(0, 0, 0)
|
||||
scale_min = 0.5
|
||||
scale_max = 0.5
|
||||
scale_curve = SubResource("CurveTexture_6bcs1")
|
||||
alpha_curve = SubResource("CurveTexture_c22if")
|
||||
|
||||
[node name="VectorStar" instance=ExtResource("1_fyvdf")]
|
||||
script = ExtResource("2_1u5ed")
|
||||
lifeDistance = 3000.0
|
||||
|
||||
[node name="texture" parent="." index="0"]
|
||||
rotation = 0.0174533
|
||||
sprite_frames = SubResource("SpriteFrames_jj20o")
|
||||
|
||||
[node name="particles" type="GPUParticles2D" parent="." index="2"]
|
||||
amount = 20
|
||||
process_material = SubResource("ParticleProcessMaterial_bieyj")
|
||||
texture = ExtResource("2_7b7fr")
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=16 format=3 uid="uid://bm7ymrri6pykb"]
|
||||
[gd_scene load_steps=17 format=3 uid="uid://bm7ymrri6pykb"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_e5pl8"]
|
||||
[ext_resource type="Script" path="res://scripts/Contents/Characters/Rooster.gd" id="2_oqdqd"]
|
||||
@@ -11,6 +11,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://wl8u5m52708w" path="res://components/Weapons/LGBT.tscn" id="4_pb8qn"]
|
||||
[ext_resource type="PackedScene" uid="uid://cxabqjo7skxev" path="res://components/Weapons/BigLaser.tscn" id="4_plqwu"]
|
||||
[ext_resource type="AudioStream" uid="uid://dmxh3bpk8vyy5" path="res://resources/sounds/effect/Coin.mp3" id="5_xnbhq"]
|
||||
[ext_resource type="PackedScene" uid="uid://bb1uh8k7gkhr7" path="res://components/Weapons/VectorStar.tscn" id="6_fvy5n"]
|
||||
[ext_resource type="AudioStream" uid="uid://4wuuf1osk0yv" path="res://resources/sounds/effect/Low Boing.wav" id="6_m5px1"]
|
||||
[ext_resource type="AudioStream" uid="uid://b10u6iir6uvqn" path="res://resources/sounds/effect/BigLaser.wav" id="8_7dhim"]
|
||||
|
||||
@@ -51,6 +52,9 @@ process_mode = 4
|
||||
|
||||
[node name="BigLaser" parent="weaponStore" index="2" instance=ExtResource("4_plqwu")]
|
||||
|
||||
[node name="VectorStar" parent="weaponStore" index="3" instance=ExtResource("6_fvy5n")]
|
||||
debugRebuild = false
|
||||
|
||||
[node name="sprint" parent="sounds" index="0"]
|
||||
stream = ExtResource("4_66s6c")
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://bb1uh8k7gkhr7"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://ckq2cq6m23hq3" path="res://components/Abstracts/WeaponCardBase.tscn" id="1_tmgup"]
|
||||
[ext_resource type="Script" path="res://scripts/Contents/Weapons/VectorStarWeapon.gd" id="2_1dfg4"]
|
||||
[ext_resource type="Texture2D" uid="uid://d2pndtow16635" path="res://resources/bullets/lgbt-bullet/造型2.svg" id="3_wfty8"]
|
||||
|
||||
[node name="VectorStar" instance=ExtResource("1_tmgup")]
|
||||
script = ExtResource("2_1dfg4")
|
||||
avatarTexture = ExtResource("3_wfty8")
|
||||
displayName = "星辰核心"
|
||||
quality = 2
|
||||
store = {
|
||||
"atk": 5,
|
||||
"forwardtime": 1,
|
||||
"maxcount": 6,
|
||||
"mincount": 3
|
||||
}
|
||||
storeType = Array[int]([0, 0, 0, 0])
|
||||
descriptionTemplate = "发射$mincount~$maxcount个[b]无主的矢量星[/b],在$forwardtime秒后向目标冲刺并造成$atk点伤害。"
|
||||
needEnergy = 20.0
|
||||
|
||||
[node name="avatar" parent="container/info" index="0"]
|
||||
texture = ExtResource("3_wfty8")
|
||||
|
||||
[node name="energy" parent="container/info/infos/energyInfo" index="1"]
|
||||
text = "20.0"
|
||||
|
||||
[node name="name" parent="container/info" index="2"]
|
||||
displayName = "星辰核心"
|
||||
quality = 2
|
||||
|
||||
[node name="description" parent="container" index="2"]
|
||||
text = "[center]发射[color=cyan]3.0[/color]~[color=cyan]6.0[/color]个[b]无主的矢量星[/b],在[color=cyan]1.0[/color]秒后向目标冲刺并造成[color=cyan]5.0[/color]点伤害。[/center]"
|
||||
@@ -15,6 +15,11 @@ run/main_scene="res://components/Scenes/World.tscn"
|
||||
config/features=PackedStringArray("4.3", "GL Compatibility")
|
||||
config/icon="res://icon.svg"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/viewport_width=1280
|
||||
window/size/viewport_height=720
|
||||
|
||||
[dotnet]
|
||||
|
||||
project/assembly_name="ChickenVSBear"
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
extends BulletBase
|
||||
class_name VectorStar
|
||||
|
||||
var tracer: EntityBase = null
|
||||
var forwardTime: float = 1000
|
||||
var forwarded: bool = false
|
||||
|
||||
func ai():
|
||||
texture.rotation_degrees *= 1.1
|
||||
PresetAIs.forward(self, rotation)
|
||||
if timeLived() <= forwardTime:
|
||||
speed = 10 * ((forwardTime - timeLived()) / forwardTime)
|
||||
elif forwarded:
|
||||
speed = (timeLived() - forwardTime) / 20
|
||||
else:
|
||||
forwarded = true
|
||||
if is_instance_valid(tracer):
|
||||
rotation = position.angle_to_point(tracer.position)
|
||||
@@ -0,0 +1,19 @@
|
||||
@tool
|
||||
extends Weapon
|
||||
class_name VectorStarWeapon
|
||||
|
||||
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
||||
origin["atk"] += 2 * to
|
||||
origin["forwardtime"] /= 1.05 * to
|
||||
origin["mincount"] += 1 * level
|
||||
origin["maxcount"] += 1 * level
|
||||
return origin
|
||||
func attack(entity: EntityBase):
|
||||
var weaponPos = entity.findWeaponAnchor("normal")
|
||||
for i in range(int(randi_range(readStore("mincount"), readStore("maxcount")))):
|
||||
for j in BulletBase.generate(preload("res://components/Bullets/VectorStar.tscn"), entity, weaponPos, deg_to_rad(randf_range(0, 360))):
|
||||
var bullet: VectorStar = j
|
||||
bullet.damage = readStore("atk")
|
||||
bullet.tracer = EntityTool.findClosetEntity(get_global_mouse_position(), get_tree(), !entity.isPlayer(), entity.isPlayer())
|
||||
bullet.forwardTime = readStore("forwardtime") * 1000
|
||||
return true
|
||||
Reference in New Issue
Block a user