presque fini

This commit is contained in:
2024-10-22 19:29:44 +02:00
parent 5df8824b50
commit 8bfc2c8515
27 changed files with 1108 additions and 178 deletions

View File

@@ -1,11 +1,13 @@
using Godot;
using System;
using System.Collections.Generic;
using System.Diagnostics;
public partial class DoorView : Control
{
[Export] Sprite2D mob;
[Export] AnimationPlayer anim;
[Export] Control menu;
Texture2D mobTex {get; set;}
@@ -18,20 +20,35 @@ public partial class DoorView : Control
bool shot {get; set;}= true;
bool caniche {get; set;}= false;
CharacterBody2D player;
[Export] Label text_mob;
[Export] Button butA;
[Export] Button butB;
bool trick_bool = false;
List<string> txt = new List<string>();
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
txt.Add("Black spell of destruction");
txt.Add("Necromancy");
txt.Add("Freezing Moon");
txt.Add("Journey to the stars");
txt.Add("The power of souls");
txt.Add("Mutilations internes");
txt.Add("Manual Breathing");
txt.Add("Spectral visions of mental warfare");
player = (CharacterBody2D)GetParent().GetParent();
}
public async void start()
{
trick_bool = false;
GetParent<Camera2D>().PositionSmoothingEnabled = false;
Input.MouseMode = Input.MouseModeEnum.Visible;
GetTree().Paused = true;
@@ -45,7 +62,8 @@ public partial class DoorView : Control
}
else if (caniche)
{
anim.Play("can");
anim.Play("cani");
player.Call("OverCanicheAsync");
}
else
{
@@ -55,6 +73,7 @@ public partial class DoorView : Control
public void stop()
{
Input.MouseMode = Input.MouseModeEnum.Hidden;
GetParent<Camera2D>().PositionSmoothingEnabled = false;
GetTree().Paused = false;
Visible = false;
@@ -71,7 +90,11 @@ public partial class DoorView : Control
public void APressed()
{
if(answerA_good)
if(trick_bool)
{
anim.Play("close");
}
else if(answerA_good)
{
player.Set("sugar", (int)player.Get("sugar") + GD.RandRange(20, 40));
}
@@ -80,10 +103,25 @@ public partial class DoorView : Control
public void BPressed()
{
if(!answerA_good)
if(trick_bool)
{
anim.Play("close");
}
else if(!answerA_good)
{
player.Set("sugar", (int)player.Get("sugar") + GD.RandRange(20, 40));
}
stop();
}
public void TrickPressed()
{
trick_bool = true;
int s = (int)menu.Get("spell");
menu.Set("spell", ++s);
text_mob.Text = "-You have casted : " + txt[s-1] + "\n- It : ...?";
butA.Text = "##############";
butB.Text = "##############";
anim.Play("question");
}
}