Bob a des dialogues conditionels

This commit is contained in:
Thomas
2025-03-29 17:24:36 +01:00
parent 6edefc58d0
commit 93f4bc39b4
8 changed files with 154 additions and 116 deletions

View File

@@ -1,14 +1,36 @@
~ start
Bob: Bonjour l'ami.
if GameState.playerIsDeaf:
Bob: BONJOUR L'AMI [if GameState.hasChosenNotToMakeChoices]QUI N'AIME PAS FAIRE DE CHOIX[/if]! JE PARLE FORT POUR QUE TU ENTENDES OKAY?
else:
Bob: Bonjour l'ami [if GameState.hasChosenNotToMakeChoices]qui n'aime pas faire de choix[/if]
if GameState.hasCompletedBobDialogue == true
Bob: On s'est déjà tout dit, tchö => END
if GameState.isUsingTouch == false
Bob: Je vois que t'es venu au clavier!
else:
Bob: Je vois que t'es venu avec tes petits doigts!
% Bob: Qu'estce qui t'amène sur chaussette sale??
%
Bob: Est-ce que tu connais les contrôles du jeu?
Bob: En vrai, si tu est venu jusqu'à moi et qu'on parle, je suppose que oui!
Bob: Est-ce que tu veux faire des choix?
- Non merci
- Non merci [if GameState.hasChosenNotToMakeChoices == false]
Bob: Petit chenapan! Tu viens d'en faire un, tu m'a l'air d'un sacré loustic, allez file avant que je t'oublies
- Oui!
set GameState.hasChosenNotToMakeChoices = true
- Oui! [if GameState.hasChosenToMakeChoices == false]
Bob: Je savais que tu choisirai quelque chose. Bravo pour ce choix conséquent qui aura des conséquences conséquentes.
- Je veux recommencer cette discussion hyper utile à ma vie => start
- je me casse! => END
set GameState.hasChosenToMakeChoices = true
- Pardon? J'ai mal entendu [if GameState.playerIsDeaf == false]
set GameState.playerIsDeaf = true
=> start
- Oula! je'm'casse!
if GameState.hasChosenToMakeChoices == true and GameState.hasChosenToMakeChoices == true
=> next_dialogue
=> END
~ next_dialogue
Bob: Attends, avant que tu partes, j'aimerais te parler un peu
Bob: Ici c'est un peu vide pour le moment, c'est normal, c'est en construction.
Bob: Mais ne prends pas peur, explore un peu et reviens dans quelques temps, il y aura peut être même un peu de gameplay!
set GameState.hasCompletedBobDialogue = true
=> END

View File

@@ -14,7 +14,7 @@
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_a4vmx"]
radius = 5.0
height = 48.0
height = 33.32
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_85jde"]

View File

@@ -13,6 +13,9 @@ var humanInteractionTarget: Human = null
@onready var state_machine := animation_tree.get("parameters/HumanState/playback") as AnimationNodeStateMachinePlayback
@onready var interactionZone : InteractionZone = $"interaction zone"
var interactionClueFor : Human
var interactionPaused= false
signal start_intracting
var last_facing_direction = Vector2(0,1) # facing south
@@ -31,6 +34,11 @@ func face(whereToFace: Vector2) -> void:
func decideAction() -> void:
pass
func _unhandled_input(event: InputEvent) -> void:
if interactionPaused and interactionClueFor:
interactionPaused = false
enable_interaction_clue(interactionClueFor)
func updateFacingDirectionInAnimationTree():
animation_tree.set("parameters/HumanState/grabing/blend_position", last_facing_direction)
animation_tree.set("parameters/HumanState/idling/blend_position", last_facing_direction)
@@ -67,15 +75,24 @@ func _on_area_2d_body_entered(body: Node2D) -> void:
func start_interaction(askingForInteraction: Human):
emit_signal("start_intracting", askingForInteraction)
disable_interaction_clue()
interactionPaused = true
pause_or_stop_interaction_clue()
func stop_interaction():
humanInteractionTarget = null
func get_feet_global_position():
return global_position + Vector2(0, 43)
func pause_or_stop_interaction_clue():
if interactionZone:
var mat = $Sprite2D.get("material") as ShaderMaterial
if mat:
mat.set_shader_parameter("line_thickness", 0)
interactionZone.disable_interaction_clue()
func enable_interaction_clue(from: Human):
interactionClueFor = from
if interactionZone:
var mat = $Sprite2D.get("material") as ShaderMaterial
if mat:
@@ -83,8 +100,6 @@ func enable_interaction_clue(from: Human):
interactionZone.enable_interaction_clue(from)
func disable_interaction_clue():
if interactionZone:
var mat = $Sprite2D.get("material") as ShaderMaterial
if mat:
mat.set_shader_parameter("line_thickness", 0)
interactionZone.disable_interaction_clue()
interactionClueFor = null
interactionPaused = false
pause_or_stop_interaction_clue()

View File

@@ -39,9 +39,6 @@ func _ready() -> void:
if (obstacles.get_cell_tile_data(tile_position) != null and
obstacles.get_cell_tile_data(tile_position).get_collision_polygons_count(0)):
astar_grid.set_point_solid(tile_position)
#TODO find if the world cell is matching a semaphore pylon
func _process(delta: float) -> void:
if !controled:

View File

@@ -10,7 +10,7 @@
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_a4vmx"]
radius = 5.0
height = 48.0
height = 44.0
[sub_resource type="AnimationNodeTimeScale" id="AnimationNodeTimeScale_85jde"]