fin de séance

Co-authored-by: gdamms <gdamms@users.noreply.github.com>
This commit is contained in:
Laureηt 2021-12-01 09:48:38 +01:00
parent fc39e23394
commit 8a1565708c
No known key found for this signature in database
GPG key ID: D88C6B294FD40994
4 changed files with 242 additions and 8 deletions

156
enigme.game Normal file
View file

@ -0,0 +1,156 @@
{
"Explorateur": {
"taille": 3,
"connaissances": [],
"objets": [
"tentative",
"tentative",
"tentative"
]
},
"Territoire": {
"Lieux": [
{
"nom": "Énigme",
"descriptions": [
{
"nom": "lieu de départ",
"condition": "(true)"
}
],
"deposable": "(false)",
"depart": "(true)",
"fin": "(false)",
"connaissances": [],
"personnes": [
"Sphinx"
],
"objets": []
},
{
"nom": "Succès",
"description": [
{
"nom": "lieu succès",
"condition": "(true)"
}
],
"deposable": "(false)",
"depart": "(false)",
"fin": "(true)",
"connaissances": [],
"personnes": [],
"objets": []
},
{
"nom": "Échec",
"description": [
{
"nom": "lieu échec",
"condition": "(true)"
}
],
"deposable": "(false)",
"depart": "(false)",
"fin": "(true)",
"connaissances": [],
"personnes": [],
"objets": []
}
],
"Chemins": [
{
"lieu_in": "Énigme",
"lieu_out": "Succès",
"ouvert": "(true)",
"visible": "(Réussite==1)",
"obligatoire": "(false)",
"connaissances_gift": [],
"objets_gift": [],
"objets_conso": [],
"descriptions": [
{
"texte": "Le chemin de la victoire !",
"condition": "(true)"
}
]
},
{
"lieu_in": "Énigme",
"lieu_out": "Échec",
"ouvert": "(true)",
"visible": "(tentatives==0)",
"obligatoire": "(false)",
"connaissances": [],
"objets": [],
"objets_conso": [],
"descriptions": [
{
"texte": "Le chemin de la loose !",
"condition": "(true)"
}
]
}
]
},
"Objets": [
{
"nom": "tentative",
"taille": 1,
"visible": "(true)",
"descriptions": [
{
"texte": "permet répondre une question du sphinx",
"condition": "(true)"
}
]
}
],
"Connaissances": [
{
"nom": "Réussite",
"visible": "(true)",
"descriptions": [
{
"nom": "Permet de se casser de là",
"condition": "(true)"
}
]
}
],
"Personnes": [
{
"nom": "Sphinx",
"visible": "(true)",
"obligatoire": "(true)",
"interactions": [
{
"visible": "(true)",
"connaissances": [],
"objets_recus": [],
"actions": [
{
"visible": "(true)",
"connaissances": [
"Réussite"
],
"objets_gift": [],
"objets_conso": [
"tentative"
]
},
{
"visible": "(true)",
"connaissances": [],
"objets_recus": [],
"objets_conso": [
"tentative"
]
}
]
}
]
}
],
"Transformations": []
}

View file

@ -7,13 +7,13 @@ public class Action {
public Action(
Boolean visible,
List<Connaissance> connaissancesGift,
List<Objet> objetsGift,
List<Connaissance> connaissances,
List<Objet> objetsRecus,
List<Objet> objetsConso,
Condition finInterraction) {
this.visible = visible;
this.connaissancesGift = connaissancesGift;
this.objetsGift = objetsGift;
this.connaissancesGift = connaissances;
this.objetsRecus = objetsRecus;
this.objetsConso = objetsConso;
this.finInterraction = finInterraction;
}

View file

@ -1,3 +1,5 @@
import java.util.ArrayList;
public class Jeu {
public static Explorateur explorateur;
Territoire territoire;
@ -18,4 +20,82 @@ public class Jeu {
this.personnes = personnes;
this.transformations = transformations;
}
public static void main(String[] args) {
Condition faux = new Condition(new ConditionEt(new ConditionBoolean(false)));
Condition vraie = new Condition(new ConditionEt(new ConditionBoolean(true)));
int explorateur_tailleInventaire = 3;
List<Objet> explorateur_inventaire = new ArrayList<>();
List<Connaissance> explorateur_connaissances = new ArrayList<>();
Jeu.explorateur = new Explorateur(
explorateur_tailleInventaire,
explorateur_inventaire,
explorateur_connaissances);
List<Lieu> lieux = new ArrayList<>();
List<Personne> debut_personnes = new ArrayList<>();
List<Description> debut_descriptions = new ArrayList<>();
List<Objet> debut_objets = new ArrayList<>();
List<Connaissance> debut_connaissances = new ArrayList<>();
List<Interaction> sphinx_interactions = new ArrayList<>();
List<Action> sphinx_interactions_actions = new ArrayList<>();
Action action_reussite = new Action(
vraie,
new ArrayList<>().add("Réussite"),
new ArrayList<>(),
new ArrayList<>(),
vraie);
sphinx_interaction_actions.add(action_reussite);
Action action_echec = new Action(
vraie,
new ArrayList<>(),
new ArrayList<>(),
new ArrayList<>().add("tentative"),
vraie);
sphinx_interaction_actions.add(action_echec);
Interaction sphinx_interaction = new Interaction(
vraie,
new ArrayList<>(),
new ArrayList<>(),
sphinx_interactions_actions);
sphinx_interactions.add(sphinx_interaction);
Personne sphinx = new Personne(
"Sphinx",
vraie,
vraie,
sphinx_interactions);
debut_personnes.add(sphinx);
Lieu debut = new Lieu(
"Départ",
faux,
vraie,
faux,
debut_personnes,
debut_descriptions,
debut_objets,
debut_connaissances);
lieux.add(debut);
Territoire territoire = new Territoire(
lieux,
chemins);
Jeu jeu = new Jeu();
}
}

View file

@ -135,9 +135,7 @@
"Réussite"
],
"objets_gift": [],
"objets_conso": [
"tentative"
]
"objets_conso": []
},
{
"visible": "(true)",