mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 08:45:33 +00:00
Boss script resource
This commit is contained in:
parent
97027ddc33
commit
c0bd2f6824
11 changed files with 62 additions and 17 deletions
13
Resources/BossPhases/Rumia_Boss_Script.tres
Normal file
13
Resources/BossPhases/Rumia_Boss_Script.tres
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_resource type="Resource" script_class="BossScript" load_steps=7 format=3 uid="uid://d2l607uabv3d6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cdd6q2h0t1hhq" path="res://Scripts/Resources/BossPhase.cs" id="1_rrh11"]
|
||||
[ext_resource type="Resource" uid="uid://ks6fypeil6gk" path="res://Resources/BossPhases/TestBoss1.tres" id="2_mpjlq"]
|
||||
[ext_resource type="Resource" uid="uid://ccj0cqbveey8c" path="res://Resources/BossPhases/Rumia_SP1.tres" id="3_tlqss"]
|
||||
[ext_resource type="Resource" uid="uid://ddb5dqocmk6x7" path="res://Resources/BossPhases/Rumia_NS2.tres" id="4_liqsl"]
|
||||
[ext_resource type="Resource" uid="uid://hy1alw04fbds" path="res://Resources/BossPhases/Rumia_Lasers.tres" id="5_r3b4k"]
|
||||
[ext_resource type="Script" uid="uid://inasa76li3ym" path="res://Scripts/Resources/ScriptableBullets/BossScript.cs" id="6_6bmbe"]
|
||||
|
||||
[resource]
|
||||
script = ExtResource("6_6bmbe")
|
||||
Phases = Array[ExtResource("1_rrh11")]([ExtResource("2_mpjlq"), ExtResource("3_tlqss"), ExtResource("4_liqsl"), ExtResource("5_r3b4k")])
|
||||
metadata/_custom_type_script = "uid://inasa76li3ym"
|
||||
|
|
@ -19,7 +19,7 @@ _name = "Intro"
|
|||
[sub_resource type="Resource" id="Resource_cfhv5"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = []
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_0k62o"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -31,7 +31,7 @@ StartData = SubResource("Resource_cfhv5")
|
|||
[sub_resource type="Resource" id="Resource_tpb7s"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = []
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_edoov"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -43,7 +43,7 @@ StartData = SubResource("Resource_tpb7s")
|
|||
[sub_resource type="Resource" id="Resource_1sw5g"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 255
|
||||
StartingEquipment = []
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_47bot"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -73,7 +73,7 @@ _name = "Rebel Base"
|
|||
[sub_resource type="Resource" id="Resource_maxpt"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 0
|
||||
StartingEquipment = []
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_pein5"]
|
||||
script = ExtResource("2_tnajf")
|
||||
|
|
@ -128,7 +128,7 @@ metadata/_custom_type_script = "uid://dnthdjrx78u6m"
|
|||
[sub_resource type="Resource" id="Resource_7sue8"]
|
||||
script = ExtResource("1_ov731")
|
||||
EggIndex = 255
|
||||
StartingEquipment = []
|
||||
StartingEquipment = Array[ExtResource("2_bkci5")]([])
|
||||
metadata/_custom_type_script = "uid://mja0rk7n2kln"
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ognca"]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
[gd_scene load_steps=14 format=3 uid="uid://c5fiv1nioghfb"]
|
||||
[gd_scene load_steps=17 format=3 uid="uid://c5fiv1nioghfb"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bjs2u8gogvs03" path="res://Scripts/Actors/Boss.cs" id="1_4dxms"]
|
||||
[ext_resource type="Resource" uid="uid://da1vjfavqs7u2" path="res://Resources/BossPhases/Marisa/marisa_ns1.tres" id="2_q4m3q"]
|
||||
[ext_resource type="Script" uid="uid://cdd6q2h0t1hhq" path="res://Scripts/Resources/BossPhase.cs" id="3_prj5f"]
|
||||
[ext_resource type="Texture2D" uid="uid://ch72faq5f0xqr" path="res://Sprites/Actors/Marisa_boss.png" id="4_jniuv"]
|
||||
[ext_resource type="Script" uid="uid://inasa76li3ym" path="res://Scripts/Resources/ScriptableBullets/BossScript.cs" id="4_mmsvp"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwlstkdibs7oc" path="res://Scenes/HUD/BossHud.tscn" id="6_r0018"]
|
||||
[ext_resource type="Texture2D" uid="uid://csuprfskdo1qp" path="res://Sprites/Portraits/Rumia.png" id="7_h84or"]
|
||||
[ext_resource type="Script" uid="uid://c4qmuxjhheahr" path="res://Scripts/Components/ProximityPlayerDetection.cs" id="9_mgpqv"]
|
||||
|
|
@ -10,6 +12,11 @@
|
|||
[ext_resource type="PackedScene" uid="uid://cuixq5ex0j40h" path="res://Scenes/enemyBullet.tscn" id="11_xgdm8"]
|
||||
[ext_resource type="Script" uid="uid://c6467d6yx50qh" path="res://Scripts/Components/BulletSpawner.cs" id="12_4et3d"]
|
||||
|
||||
[sub_resource type="Resource" id="Resource_ygnne"]
|
||||
script = ExtResource("4_mmsvp")
|
||||
Phases = Array[ExtResource("3_prj5f")]([ExtResource("2_q4m3q")])
|
||||
metadata/_custom_type_script = "uid://inasa76li3ym"
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_8gtts"]
|
||||
radius = 7.0
|
||||
|
||||
|
|
@ -28,6 +35,7 @@ collision_mask = 9
|
|||
script = ExtResource("1_4dxms")
|
||||
BossName = "Marisa"
|
||||
Phases = Array[Resource]([ExtResource("2_q4m3q")])
|
||||
BossScript = SubResource("Resource_ygnne")
|
||||
BossHudPrefab = ExtResource("6_r0018")
|
||||
_bossPortraitTexture = ExtResource("7_h84or")
|
||||
Health = 200.0
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=17 format=3 uid="uid://d1rlw6ddpmrn8"]
|
||||
[gd_scene load_steps=18 format=3 uid="uid://d1rlw6ddpmrn8"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bjs2u8gogvs03" path="res://Scripts/Actors/Boss.cs" id="1_na4uq"]
|
||||
[ext_resource type="Resource" uid="uid://ks6fypeil6gk" path="res://Resources/BossPhases/TestBoss1.tres" id="2_1rhf6"]
|
||||
|
|
@ -11,6 +11,7 @@
|
|||
[ext_resource type="PackedScene" uid="uid://bwlstkdibs7oc" path="res://Scenes/HUD/BossHud.tscn" id="4_ehp8q"]
|
||||
[ext_resource type="PackedScene" uid="uid://crry0rgk7a8sm" path="res://Scenes/Weapons/BaseWeapon.tscn" id="4_xc6nm"]
|
||||
[ext_resource type="PackedScene" uid="uid://cuixq5ex0j40h" path="res://Scenes/enemyBullet.tscn" id="5_g1p0m"]
|
||||
[ext_resource type="Resource" uid="uid://d2l607uabv3d6" path="res://Resources/BossPhases/Rumia_Boss_Script.tres" id="6_ifwrk"]
|
||||
[ext_resource type="Script" uid="uid://c6467d6yx50qh" path="res://Scripts/Components/BulletSpawner.cs" id="7_2obh7"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_8gtts"]
|
||||
|
|
@ -31,6 +32,7 @@ collision_mask = 9
|
|||
script = ExtResource("1_na4uq")
|
||||
BossName = "Rumia"
|
||||
Phases = Array[Resource]([ExtResource("2_1rhf6"), ExtResource("3_j7lbl"), ExtResource("2_eyxw4"), ExtResource("2_p8j4e")])
|
||||
BossScript = ExtResource("6_ifwrk")
|
||||
BossHudPrefab = ExtResource("4_ehp8q")
|
||||
CameraOffset = Vector2(0, 32)
|
||||
_bossPortraitTexture = ExtResource("4_at5iq")
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://cnhgvn2salyxl"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cnhgvn2salyxl"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://b3h7b30kerf60" path="res://Scripts/Interactables/ItemPickup.cs" id="1_qo3uh"]
|
||||
[ext_resource type="Resource" uid="uid://bgcgeg187vg1h" path="res://Resources/Items/IcicleRepeater.tres" id="2_qo3uh"]
|
||||
[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="2_sb7le"]
|
||||
[ext_resource type="Texture2D" uid="uid://bxe747rnr5xt7" path="res://Sprites/Items/Ice_Repeater.png" id="3_sb7le"]
|
||||
|
||||
[sub_resource type="CircleShape2D" id="CircleShape2D_jtwy2"]
|
||||
|
|
@ -10,7 +11,7 @@
|
|||
collision_layer = 4
|
||||
collision_mask = 2
|
||||
script = ExtResource("1_qo3uh")
|
||||
LootTable = [ExtResource("2_qo3uh")]
|
||||
LootTable = Array[ExtResource("2_sb7le")]([ExtResource("2_qo3uh")])
|
||||
|
||||
[node name="Sprite2D" type="Sprite2D" parent="."]
|
||||
texture = ExtResource("3_sb7le")
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
[sub_resource type="Resource" id="Resource_6wo78"]
|
||||
script = ExtResource("4_u1i8n")
|
||||
EggIndex = 0
|
||||
StartingEquipment = []
|
||||
StartingEquipment = Array[ExtResource("5_u1i8n")]([])
|
||||
|
||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_rff8l"]
|
||||
size = Vector2(30, 52.5)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=46 format=4 uid="uid://bpnahwxmjgb6t"]
|
||||
[gd_scene load_steps=47 format=4 uid="uid://bpnahwxmjgb6t"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://doxmbokehw8ci" path="res://Scripts/GameManager.cs" id="1_qxyfr"]
|
||||
[ext_resource type="PackedScene" uid="uid://c4pr2707hbeph" path="res://Scenes/Actors/fsm_player.tscn" id="2_ajkcn"]
|
||||
[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="3_douri"]
|
||||
[ext_resource type="Script" uid="uid://mja0rk7n2kln" path="res://Scripts/Resources/MapStartDataResource.cs" id="4_g48r8"]
|
||||
[ext_resource type="TileSet" uid="uid://6k28roiljylj" path="res://Tilesets/factory_tileset.tres" id="5_2m462"]
|
||||
[ext_resource type="Script" uid="uid://krean0uywtms" path="res://Scripts/TilemapAvoidance.cs" id="6_bnfdx"]
|
||||
|
|
@ -34,7 +35,7 @@
|
|||
[sub_resource type="Resource" id="Resource_6wo78"]
|
||||
script = ExtResource("4_g48r8")
|
||||
EggIndex = 0
|
||||
StartingEquipment = []
|
||||
StartingEquipment = Array[ExtResource("3_douri")]([])
|
||||
|
||||
[sub_resource type="Resource" id="Resource_hppa0"]
|
||||
script = ExtResource("14_wc2f3")
|
||||
|
|
|
|||
|
|
@ -214,7 +214,7 @@ SpawnMarkers = Dictionary[int, NodePath]({
|
|||
2: NodePath("Factory Tilemaps/LevelProps/BossDebugTeleporterDestination"),
|
||||
255: NodePath("Factory Tilemaps/Debug Room/DebugRoomStartPosition")
|
||||
})
|
||||
StartingEquipment = [ExtResource("4_swym2"), ExtResource("5_nqier")]
|
||||
StartingEquipment = Array[ExtResource("6_8tdlb")]([ExtResource("4_swym2"), ExtResource("5_nqier")])
|
||||
MapStartData = SubResource("Resource_6sau4")
|
||||
metadata/_edit_lock_ = true
|
||||
|
||||
|
|
@ -972,7 +972,7 @@ position = Vector2(-2000, -736)
|
|||
[node name="ControlPad8" parent="Factory Tilemaps/LevelProps" node_paths=PackedStringArray("Targets") instance=ExtResource("12_hfkf1")]
|
||||
position = Vector2(-2027, -735)
|
||||
Targets = [NodePath("../HorizontalForceField")]
|
||||
Requirements = [ExtResource("84_ma1ta")]
|
||||
Requirements = Array[ExtResource("6_8tdlb")]([ExtResource("84_ma1ta")])
|
||||
|
||||
[node name="IcicleRepeater2" parent="Factory Tilemaps/LevelProps" instance=ExtResource("32_xof4a")]
|
||||
position = Vector2(-923, 69)
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System.Threading.Tasks;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Cirno.Scripts.Resources.ScriptableBullets;
|
||||
using Cirno.Scripts.UI;
|
||||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
|
@ -9,7 +10,8 @@ namespace Cirno.Scripts.Actors;
|
|||
public partial class Boss : Enemy, IActivable
|
||||
{
|
||||
[Export] public string BossName { get; private set; }
|
||||
[Export] private Array<BossPhase> Phases;
|
||||
//[Export] private Array<BossPhase> Phases;
|
||||
[Export] public BossScript BossScript { get; private set; }
|
||||
[Export] private PackedScene BossHudPrefab;
|
||||
[Export] public Vector2 BossPhaseAnimationStartingPosition = new Vector2(180, 10);
|
||||
|
||||
|
|
@ -22,7 +24,7 @@ public partial class Boss : Enemy, IActivable
|
|||
public GameManager GameManager => _gameManager;
|
||||
private Vector2 _homePosition;
|
||||
public Vector2 HomePosition => _homePosition;
|
||||
private BossPhase CurrentPhase => Phases[currentPhaseIndex];
|
||||
private BossPhase CurrentPhase => BossScript.Phases[currentPhaseIndex];
|
||||
|
||||
private Marker2D _cameraMarker;
|
||||
|
||||
|
|
@ -39,6 +41,12 @@ public partial class Boss : Enemy, IActivable
|
|||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
if (BossScript is null)
|
||||
{
|
||||
GD.PrintErr($"No boss script defined in {this.Name}");
|
||||
return;
|
||||
}
|
||||
|
||||
_gameManager = this.GetGameManager();
|
||||
|
||||
_homePosition = this.GlobalPosition;
|
||||
|
|
@ -90,7 +98,7 @@ public partial class Boss : Enemy, IActivable
|
|||
if (_waiting) return;
|
||||
|
||||
CurrentPhase.UpdatePhase(delta);
|
||||
if (_currentHealth <= CurrentPhase.Threshold && currentPhaseIndex + 1 < Phases.Count)
|
||||
if (_currentHealth <= CurrentPhase.Threshold && currentPhaseIndex + 1 < BossScript.Phases.Count)
|
||||
{
|
||||
currentPhaseIndex++;
|
||||
_bossHud.SpellCardName = CurrentPhase.PhaseName;
|
||||
|
|
|
|||
11
Scripts/Resources/ScriptableBullets/BossScript.cs
Normal file
11
Scripts/Resources/ScriptableBullets/BossScript.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using Godot;
|
||||
using Godot.Collections;
|
||||
|
||||
namespace Cirno.Scripts.Resources.ScriptableBullets;
|
||||
|
||||
[GlobalClass]
|
||||
public partial class BossScript : Resource
|
||||
{
|
||||
[Export]
|
||||
public Array<BossPhase> Phases { get; private set; } = [];
|
||||
}
|
||||
1
Scripts/Resources/ScriptableBullets/BossScript.cs.uid
Normal file
1
Scripts/Resources/ScriptableBullets/BossScript.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://inasa76li3ym
|
||||
Loading…
Add table
Add a link
Reference in a new issue