mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-28 06:51:54 +08:00
Compare commits
6 Commits
d039e252f6
...
52a6f6b3c5
| Author | SHA1 | Date | |
|---|---|---|---|
| 52a6f6b3c5 | |||
| 75adfed454 | |||
| 0d3c1790af | |||
| 15e5bcb5bc | |||
| 11a293378c | |||
| 7e48372902 |
@@ -2,7 +2,10 @@
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bs863g2s8r770" path="res://components/Abstracts/PlayerBase.tscn" id="1_eeneu"]
|
||||
[ext_resource type="Script" uid="uid://bevc4f6apql4t" path="res://scripts/Contents/Characters/HCN.gd" id="2_f7uj3"]
|
||||
[ext_resource type="PackedScene" uid="uid://wl8u5m52708w" path="res://components/Weapons/LGBT.tscn" id="3_2fpmn"]
|
||||
|
||||
[node name="HCN" unique_id=1711205167 instance=ExtResource("1_eeneu")]
|
||||
script = ExtResource("2_f7uj3")
|
||||
displayName = "氰化氢"
|
||||
|
||||
[node name="LGBT" parent="weaponStore" index="0" unique_id=1938660022 instance=ExtResource("3_2fpmn")]
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bs863g2s8r770" path="res://components/Abstracts/PlayerBase.tscn" id="1_ns0m5"]
|
||||
[ext_resource type="Script" uid="uid://b8g0hkqvyeptg" path="res://scripts/Contents/Characters/Lynx.gd" id="2_d6nve"]
|
||||
[ext_resource type="PackedScene" uid="uid://frwt0fgrpskb" path="res://components/Weapons/Meowmere.tscn" id="3_nitbu"]
|
||||
|
||||
[node name="Lynx" unique_id=1711205167 instance=ExtResource("1_ns0m5")]
|
||||
script = ExtResource("2_d6nve")
|
||||
displayName = "猞猁"
|
||||
|
||||
[node name="Meowmere" parent="weaponStore" index="0" unique_id=1965287972 instance=ExtResource("3_nitbu")]
|
||||
|
||||
@@ -2,7 +2,10 @@
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://bs863g2s8r770" path="res://components/Abstracts/PlayerBase.tscn" id="1_y3l4w"]
|
||||
[ext_resource type="Script" uid="uid://bbmb572iba42l" path="res://scripts/Contents/Characters/MuyangDog.gd" id="2_mr6nm"]
|
||||
[ext_resource type="PackedScene" uid="uid://u0djqwuuysp8" path="res://components/Weapons/Volcano.tscn" id="3_e236u"]
|
||||
|
||||
[node name="MuyangDog" unique_id=1711205167 instance=ExtResource("1_y3l4w")]
|
||||
script = ExtResource("2_mr6nm")
|
||||
displayName = "牧羊犬"
|
||||
|
||||
[node name="Volcano" parent="weaponStore" index="0" unique_id=204992396 instance=ExtResource("3_e236u")]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://dmxi1ikn6avig"]
|
||||
[gd_scene format=3 uid="uid://dmxi1ikn6avig"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://d2oyyyg0b4qqd" path="res://scripts/Tools/Managers/WorldManager.gd" id="1_lxsxj"]
|
||||
[ext_resource type="PackedScene" uid="uid://dfwg750a47ggx" path="res://components/Scenes/UI.tscn" id="2_04cdd"]
|
||||
@@ -66,57 +66,62 @@ _data = {
|
||||
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_lu72f"]
|
||||
normal = Vector2(0, 1)
|
||||
|
||||
[node name="world" type="Node2D"]
|
||||
[node name="world" type="Node2D" unique_id=1992792389]
|
||||
y_sort_enabled = true
|
||||
texture_filter = 1
|
||||
script = ExtResource("1_lxsxj")
|
||||
metadata/_edit_vertical_guides_ = [-1.0, 57.0]
|
||||
|
||||
[node name="spawner" type="MultiplayerSpawner" parent="."]
|
||||
[node name="spawner" type="MultiplayerSpawner" parent="." unique_id=1891214291]
|
||||
unique_name_in_owner = true
|
||||
spawn_path = NodePath("..")
|
||||
|
||||
[node name="UI" parent="." instance=ExtResource("2_04cdd")]
|
||||
[node name="UI" parent="." unique_id=1312059514 instance=ExtResource("2_04cdd")]
|
||||
|
||||
[node name="camera" type="Camera2D" parent="."]
|
||||
[node name="camera" type="Camera2D" parent="." unique_id=996511427]
|
||||
process_mode = 3
|
||||
process_callback = 0
|
||||
limit_left = -2400
|
||||
limit_top = -1800
|
||||
limit_right = 2400
|
||||
limit_bottom = 1800
|
||||
position_smoothing_enabled = true
|
||||
drag_horizontal_enabled = true
|
||||
drag_vertical_enabled = true
|
||||
editor_draw_limits = true
|
||||
script = ExtResource("5_mk7bv")
|
||||
constantOffset = Vector2(0, -80)
|
||||
|
||||
[node name="animator" type="AnimationPlayer" parent="camera"]
|
||||
[node name="animator" type="AnimationPlayer" parent="camera" unique_id=619200978]
|
||||
unique_name_in_owner = true
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_44ixa")
|
||||
}
|
||||
libraries/ = SubResource("AnimationLibrary_44ixa")
|
||||
|
||||
[node name="map" type="StaticBody2D" parent="." groups=["map"]]
|
||||
[node name="map" type="StaticBody2D" parent="." unique_id=385091617 groups=["map"]]
|
||||
collision_layer = 6
|
||||
collision_mask = 6
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="background" type="Sprite2D" parent="map"]
|
||||
[node name="background" type="Sprite2D" parent="map" unique_id=792319336]
|
||||
z_index = -100
|
||||
scale = Vector2(5, 5)
|
||||
texture = ExtResource("4_oy4jj")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
[node name="borderTop" type="CollisionShape2D" parent="map"]
|
||||
[node name="borderTop" type="CollisionShape2D" parent="map" unique_id=320842136]
|
||||
position = Vector2(0, -1800)
|
||||
shape = SubResource("WorldBoundaryShape2D_lu72f")
|
||||
|
||||
[node name="borderTop2" type="CollisionShape2D" parent="map"]
|
||||
[node name="borderTop2" type="CollisionShape2D" parent="map" unique_id=1208131017]
|
||||
position = Vector2(0, 1800)
|
||||
rotation = 3.1415927
|
||||
shape = SubResource("WorldBoundaryShape2D_lu72f")
|
||||
|
||||
[node name="borderTop3" type="CollisionShape2D" parent="map"]
|
||||
[node name="borderTop3" type="CollisionShape2D" parent="map" unique_id=585247179]
|
||||
position = Vector2(2400, 0)
|
||||
rotation = 1.5707964
|
||||
shape = SubResource("WorldBoundaryShape2D_lu72f")
|
||||
|
||||
[node name="borderTop4" type="CollisionShape2D" parent="map"]
|
||||
[node name="borderTop4" type="CollisionShape2D" parent="map" unique_id=320391894]
|
||||
position = Vector2(-2400, 0)
|
||||
rotation = -1.5707964
|
||||
shape = SubResource("WorldBoundaryShape2D_lu72f")
|
||||
|
||||
@@ -89,7 +89,10 @@ func startSingleplayerGame():
|
||||
), OutGameStorage.upgradableFieldsValue)
|
||||
UIState.player = EntityBase.generatePlayer(playerNameInput.text, selectedCharacter, extras)
|
||||
WorldManager.rootNode.spawnWave(Vector2.ZERO)
|
||||
UIState.setPanel("CompilingTip")
|
||||
if buildingShader:
|
||||
UIState.setPanel("CompilingTip")
|
||||
else:
|
||||
UIState.setPanel("SelectInitialFeed")
|
||||
|
||||
func _ready():
|
||||
historyStack = Composables.useHistoryStack(playerNameInput)
|
||||
|
||||
@@ -136,10 +136,6 @@ func _ready():
|
||||
if isPlayer():
|
||||
if displayName == MultiplayerState.playerName:
|
||||
UIState.player = self
|
||||
if WorldManager.isRelease():
|
||||
for i in weaponStore.get_children():
|
||||
i.queue_free()
|
||||
weaponStore.add_child(ComponentManager.getWeapon("PurpleCrystal").instantiate())
|
||||
for i in weaponStore.get_children():
|
||||
i.hide()
|
||||
weapons.append(i)
|
||||
@@ -448,7 +444,7 @@ func tryDie(by: BulletBase = null):
|
||||
UIState.showTip("[b]%s[/b] 已被打败!" % displayName, TipBox.MessageType.CONGRATULATION)
|
||||
elif isPlayer():
|
||||
UIState.showTip("[b]%s[/b] 似了😭。" % displayName, TipBox.MessageType.ERROR)
|
||||
if !isPlayer():
|
||||
if !isPlayer() || isSummon():
|
||||
queue_free()
|
||||
func tryHeal(count: float):
|
||||
playSound("heal")
|
||||
@@ -564,7 +560,6 @@ static func findPlayer(playerName: String) -> EntityBase:
|
||||
static func generatePlayer(playerName: String, character: String, extraFields: Dictionary = {}) -> EntityBase:
|
||||
var player = generate(ComponentManager.getCharacter(character), Vector2.ZERO, false, false, true, playerName)
|
||||
player.name = "Player_%s" % playerName
|
||||
print(extraFields)
|
||||
var feed = ComponentManager.getAbstract("FeedCardBase").instantiate() as Feed
|
||||
for field in extraFields:
|
||||
feed.fields.append(field)
|
||||
|
||||
@@ -48,19 +48,10 @@ func _physics_process(_delta):
|
||||
if !fieldsAnimator.is_playing():
|
||||
if showingFields:
|
||||
if Input.is_action_just_released("showFields") || !(currentPanel is PausePanel):
|
||||
showingFields = false
|
||||
fieldsAnimator.play("hide")
|
||||
hideFields()
|
||||
else:
|
||||
if Input.is_action_just_pressed("showFields") || currentPanel is PausePanel:
|
||||
showingFields = true
|
||||
for i in fields.get_children():
|
||||
fields.remove_child(i)
|
||||
for i in player.fields:
|
||||
if player.fields[i] == EntityBase.TITLE_FLAG:
|
||||
fields.add_child(QuickUI.graySmallText(i))
|
||||
else:
|
||||
fields.add_child(FieldShow.create(i, player.fields[i], false, player, true))
|
||||
fieldsAnimator.play("show")
|
||||
showFields()
|
||||
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
if currentPanel:
|
||||
@@ -100,6 +91,7 @@ static func setPanel(targetName: String = "", args: Array = []):
|
||||
panel.hidePanel()
|
||||
static func closeCurrentPanel():
|
||||
setPanel()
|
||||
|
||||
static func showTip(text: String, messageType: TipBox.MessageType = TipBox.MessageType.INFO):
|
||||
var box = TipBox.create(text, messageType)
|
||||
tips.add_child(box)
|
||||
@@ -110,3 +102,17 @@ static func clearTips():
|
||||
for child in tips.get_children():
|
||||
if child is TipBox:
|
||||
child.destroy()
|
||||
|
||||
static func showFields():
|
||||
showingFields = true
|
||||
for i in fields.get_children():
|
||||
fields.remove_child(i)
|
||||
for i in player.fields:
|
||||
if player.fields[i] == EntityBase.TITLE_FLAG:
|
||||
fields.add_child(QuickUI.graySmallText(i))
|
||||
else:
|
||||
fields.add_child(FieldShow.create(i, player.fields[i], false, player, true))
|
||||
fieldsAnimator.play("show")
|
||||
static func hideFields():
|
||||
showingFields = false
|
||||
fieldsAnimator.play("hide")
|
||||
|
||||
@@ -17,7 +17,7 @@ func _physics_process(_delta):
|
||||
if is_instance_valid(UIState.player):
|
||||
position = UIState.player.position + constantOffset
|
||||
position += MathTool.sampleInCircle(shakeIntensity)
|
||||
offset += ((get_global_mouse_position() - UIState.player.position).clampf(-100, 100) - offset) * 0.15
|
||||
position += MouseTool.getPositionByScreen(Vector2.ONE * 0.5, self ) / 2
|
||||
|
||||
static func shake(millseconds: float, intensity: float = 10, steper: Callable = func(currentValue, _totalValue, _restPercent): return currentValue):
|
||||
if StarterPanel.buildingShader: return
|
||||
|
||||
@@ -10,8 +10,10 @@ static func restart(tree: SceneTree):
|
||||
for item in tree.get_nodes_in_group("items"):
|
||||
item.queue_free()
|
||||
|
||||
UIState.hideFields()
|
||||
OutGameStorage.saveInventory()
|
||||
CameraManager.shakeStop()
|
||||
WorldManager.timeRestart()
|
||||
StarterPanel.selectingFeed = true
|
||||
|
||||
UIState.setPanel("Starter")
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
class_name MouseTool
|
||||
|
||||
static func getPositionByScreen(anchor: Vector2, by: Node):
|
||||
var viewport = by.get_viewport()
|
||||
return viewport.get_mouse_position() - viewport.get_visible_rect().size * anchor
|
||||
@@ -0,0 +1 @@
|
||||
uid://yf2h5ni3gobm
|
||||
Reference in New Issue
Block a user