mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
feat(武器系统): 重构LGBT武器和彩虹旗召唤物
调整LGBT武器属性计算公式,增加角度和数量参数 为彩虹旗召唤物添加多子弹发射和延迟发射功能 修改子弹追踪逻辑和穿透属性 更新武器描述和能量消耗
This commit is contained in:
@@ -449,6 +449,8 @@ one_shot = true
|
||||
explosiveness = 1.0
|
||||
process_material = SubResource("ParticleProcessMaterial_f3xas")
|
||||
|
||||
[node name="static" type="Sprite2D" parent="texture"]
|
||||
|
||||
[node name="statebar" parent="." instance=ExtResource("2_uje1g")]
|
||||
unique_name_in_owner = true
|
||||
position = Vector2(0, -100)
|
||||
|
||||
@@ -80,6 +80,7 @@ alpha_curve = SubResource("CurveTexture_tnhr3")
|
||||
|
||||
[node name="LGBTBullet" instance=ExtResource("1_bnhy4")]
|
||||
script = ExtResource("2_iakgr")
|
||||
penerate = 1.0
|
||||
lifeTime = 5000.0
|
||||
|
||||
[node name="texture" parent="." index="0"]
|
||||
|
||||
@@ -1,10 +1,39 @@
|
||||
[gd_scene load_steps=3 format=3 uid="uid://b83iw0a062qp"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://b83iw0a062qp"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://cvogxi7mktumf" path="res://components/Abstracts/EntityBase.tscn" id="1_fktqv"]
|
||||
[ext_resource type="Script" uid="uid://11fi3jjdm810" path="res://scripts/Contents/Summons/LGBTFlag.gd" id="2_6d456"]
|
||||
[ext_resource type="Texture2D" uid="uid://cwfyi61xkt4bt" path="res://resources/weapons/lgbt.jpeg" id="3_r6sud"]
|
||||
|
||||
[sub_resource type="SpriteFrames" id="SpriteFrames_r6sud"]
|
||||
animations = [{
|
||||
"frames": [],
|
||||
"loop": true,
|
||||
"name": &"idle",
|
||||
"speed": 5.0
|
||||
}, {
|
||||
"frames": [],
|
||||
"loop": true,
|
||||
"name": &"walk",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_r6sud"]
|
||||
size = Vector2(112, 70)
|
||||
|
||||
[node name="LGBTFlag" instance=ExtResource("1_fktqv")]
|
||||
script = ExtResource("2_6d456")
|
||||
attraction = 0.5
|
||||
|
||||
[node name="texture" parent="." index="2"]
|
||||
sprite_frames = SubResource("SpriteFrames_r6sud")
|
||||
|
||||
[node name="hitbox" parent="texture/hurtbox" index="0"]
|
||||
position = Vector2(0, 15)
|
||||
shape = SubResource("RectangleShape2D_r6sud")
|
||||
|
||||
[node name="normal" type="Node2D" parent="texture/weapons" index="0"]
|
||||
|
||||
[node name="static" parent="texture" index="7"]
|
||||
position = Vector2(0, 15)
|
||||
scale = Vector2(0.11, 0.11)
|
||||
texture = ExtResource("3_r6sud")
|
||||
|
||||
@@ -14,11 +14,11 @@ quality = 4
|
||||
typeTopic = 3
|
||||
costBeachball = 200
|
||||
store = {
|
||||
"angle": 30.0,
|
||||
"atk": 20.0,
|
||||
"count": 7.0,
|
||||
"power": 0.25,
|
||||
"trace": 2.0
|
||||
"angle": 25.0,
|
||||
"atk": 15.0,
|
||||
"count": 2.0,
|
||||
"power": 0.02,
|
||||
"trace": 1.0
|
||||
}
|
||||
storeType = {
|
||||
"angle": 3.0,
|
||||
@@ -27,9 +27,10 @@ storeType = {
|
||||
"power": 2.0,
|
||||
"trace": 0.0
|
||||
}
|
||||
descriptionTemplate = "每$angle发射1/$count条以$power效率追踪$trace秒的[b]七彩光标[/b],每条造成$atk点伤害。"
|
||||
needEnergy = 25.0
|
||||
descriptionTemplate = "召唤[b]彩虹旗[/b],每$angle发射1/$count条以$power效率追踪$trace秒的[b]七彩光标[/b],每条造成$atk点伤害。"
|
||||
needEnergy = 75.0
|
||||
cooldown = 1000.0
|
||||
debugRebuild = true
|
||||
|
||||
[node name="attack" parent="sounds" index="0"]
|
||||
stream = ExtResource("4_c5xse")
|
||||
@@ -38,7 +39,7 @@ stream = ExtResource("4_c5xse")
|
||||
texture = ExtResource("2_ou6jo")
|
||||
|
||||
[node name="energy" parent="container/info/infos/energyInfo" index="1"]
|
||||
text = "25.0"
|
||||
text = "75.0"
|
||||
|
||||
[node name="beachball" parent="container/info/infos" index="1"]
|
||||
count = 200
|
||||
@@ -53,5 +54,5 @@ typeTopic = 3
|
||||
|
||||
[node name="description" parent="container" index="2"]
|
||||
size_flags_vertical = 3
|
||||
text = "[center]每[color=cyan]30.0°[/color]发射1/[color=cyan]7[/color]条以[color=cyan]25%[/color]效率追踪[color=cyan]2.00[/color]秒的[b]七彩光标[/b],每条造成[color=cyan]20[/color]点伤害。[/center]"
|
||||
text = "[center]召唤[b]彩虹旗[/b],每[color=cyan]25.0°[/color]发射1/[color=cyan]2[/color]条以[color=cyan]2%[/color]效率追踪[color=cyan]1.00[/color]秒的[b]七彩光标[/b],每条造成[color=cyan]15[/color]点伤害。[/center]"
|
||||
autowrap_mode = 2
|
||||
|
||||
@@ -11,7 +11,7 @@ func ai():
|
||||
speed *= 1.05
|
||||
speed = clamp(speed, 0, 20)
|
||||
if is_instance_valid(tracer) and timeLived() < maxTraceTime:
|
||||
PresetBulletAI.trace(self, tracer.getTrackingAnchor(), clamp(speed / 50 * tracePower, 0, 1))
|
||||
PresetBulletAI.trace(self, tracer.getTrackingAnchor(), tracePower)
|
||||
PresetBulletAI.forward(self, rotation)
|
||||
func destroy(_b):
|
||||
EffectController.create(ComponentManager.getEffect("LGBTBoom"), position).shot()
|
||||
|
||||
@@ -3,22 +3,29 @@ extends SummonBase
|
||||
var atk: float = 0
|
||||
var maxTraceTime: float = 0
|
||||
var tracePower: float = 0
|
||||
var count: int = 0
|
||||
var angle: float = 0
|
||||
|
||||
func register():
|
||||
fields[FieldStore.Entity.MAX_HEALTH] = 500
|
||||
attackCooldownMap[0] = 250
|
||||
fields[FieldStore.Entity.MAX_HEALTH] = 150
|
||||
attackCooldownMap[0] = 1000
|
||||
func ai():
|
||||
tryAttack(0)
|
||||
func attack(type):
|
||||
if type == 0:
|
||||
var tracer = EntityTool.findClosetEntity(position, get_tree(), false, true)
|
||||
for bullet in BulletBase.generate(
|
||||
ComponentManager.getBullet("LGBTBullet"),
|
||||
self,
|
||||
findWeaponAnchor("normal"),
|
||||
position.angle_to_point(tracer.position)
|
||||
):
|
||||
bullet.tracer = tracer
|
||||
bullet.damage = atk
|
||||
bullet.maxTraceTime = maxTraceTime
|
||||
bullet.tracePower = tracePower
|
||||
var startAngle = position.angle_to_point(tracer.getTrackingAnchor()) + deg_to_rad(randf_range(-90, 90))
|
||||
for i in count:
|
||||
if !is_instance_valid(tracer):
|
||||
break
|
||||
for bullet in BulletBase.generate(
|
||||
ComponentManager.getBullet("LGBTBullet"),
|
||||
myMaster,
|
||||
findWeaponAnchor("normal"),
|
||||
startAngle + deg_to_rad(i * angle)
|
||||
):
|
||||
bullet.tracer = tracer
|
||||
bullet.damage = atk
|
||||
bullet.maxTraceTime = maxTraceTime
|
||||
bullet.tracePower = tracePower
|
||||
await TickTool.millseconds(50)
|
||||
|
||||
@@ -8,7 +8,7 @@ var from: float = 0
|
||||
var to: float = 0
|
||||
var per: int = 0
|
||||
|
||||
static var current: int = 9
|
||||
static var current: int = 0
|
||||
static var WAVE_NORMAL = [
|
||||
Wave.create("Hen", 1, 5, false, 0, INF, 1),
|
||||
Wave.create("Chick", 0, 0, true, 9, INF, 15),
|
||||
|
||||
@@ -3,13 +3,17 @@ extends Weapon
|
||||
class_name LGBTWeapon
|
||||
|
||||
func update(to: int, origin: Dictionary, _entity: EntityBase):
|
||||
origin["atk"] += 5 * to * soulLevel
|
||||
origin["power"] += 0.05 * to * soulLevel
|
||||
origin["trace"] += 0.25 * to * soulLevel
|
||||
origin["angle"] /= 1 + 0.05 * to * soulLevel
|
||||
origin["count"] += 1 * soulLevel
|
||||
origin["atk"] += 3 * to * soulLevel
|
||||
origin["power"] += 0.02 * to * soulLevel
|
||||
origin["trace"] += 0.1 * to * soulLevel
|
||||
return origin
|
||||
func attack(entity: EntityBase):
|
||||
var summon = entity.summon(ComponentManager.getSummon("LGBTFlag"), true)
|
||||
summon.atk = readStore("atk")
|
||||
summon.maxTraceTime = readStore("trace") * 1000
|
||||
summon.tracePower = readStore("power")
|
||||
summon.count = readStore("count")
|
||||
summon.angle = readStore("angle")
|
||||
return true
|
||||
|
||||
@@ -395,9 +395,9 @@ func getTrackingAnchor() -> Vector2:
|
||||
return hurtbox.get_node("hitbox").global_position
|
||||
|
||||
# 关于分组
|
||||
func isPlayer():
|
||||
func isPlayer() -> bool:
|
||||
return is_in_group("players")
|
||||
func isSummon():
|
||||
func isSummon() -> bool:
|
||||
return self is SummonBase
|
||||
|
||||
# 抽象方法,实际上是一些钩子,不需要全部实现
|
||||
|
||||
@@ -8,7 +8,7 @@ static func fromHurtbox(node: Node) -> EntityBase:
|
||||
if entity is EntityBase:
|
||||
return entity as EntityBase
|
||||
return null
|
||||
static func findClosetEntity(to: Vector2, fromTree: SceneTree, player: bool = false, mob: bool = false, excludes: Array[EntityBase] = []) -> EntityBase:
|
||||
static func findClosetEntity(to: Vector2, fromTree: SceneTree, player: bool = false, mob: bool = false, excludes: Array[EntityBase] = [], allowSummon: bool = false) -> EntityBase:
|
||||
var result = null
|
||||
var lastDistance = INF
|
||||
var nodes = []
|
||||
@@ -18,12 +18,15 @@ static func findClosetEntity(to: Vector2, fromTree: SceneTree, player: bool = fa
|
||||
nodes += fromTree.get_nodes_in_group("mobs")
|
||||
for entity in nodes:
|
||||
if entity is EntityBase and entity not in excludes:
|
||||
if !allowSummon:
|
||||
if entity.isSummon():
|
||||
continue
|
||||
if to.distance_to(entity.position) < lastDistance:
|
||||
lastDistance = to.distance_to(entity.position)
|
||||
result = entity
|
||||
return result
|
||||
static func findClosetPlayer(to: Vector2, fromTree: SceneTree, excludes: Array[EntityBase] = []) -> EntityBase:
|
||||
return findClosetEntity(to, fromTree, true, false, excludes)
|
||||
static func findClosetPlayer(to: Vector2, fromTree: SceneTree, excludes: Array[EntityBase] = [], allowSummon: bool = false) -> EntityBase:
|
||||
return findClosetEntity(to, fromTree, true, false, excludes, allowSummon)
|
||||
static func findEntityByClass(cls: String, fromTree: SceneTree) -> Array[EntityBase]:
|
||||
var results: Array[EntityBase] = []
|
||||
var nodes = fromTree.get_nodes_in_group("mobs") + fromTree.get_nodes_in_group("players")
|
||||
|
||||
Reference in New Issue
Block a user