svg
This commit is contained in:
@ -17,8 +17,79 @@ function setFixures() {
|
||||
}
|
||||
|
||||
// Config
|
||||
console.log("Fixures Config");
|
||||
console.log("Fixtures Config");
|
||||
var obj = initConfig(ctx, {"_id": "version", "default": "0.0.0","visible":false});
|
||||
|
||||
// Card
|
||||
var obj = initCard(ctx, { _id: "lose10", image: "images/cards/loose10.png", title: "Hey ! t'avais pas un billet de 10 ?", description: "Vous perdez 10€", effect: "-10", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "lose20", image: "images/cards/loose20.png", title: "On t'as vu balancer ton papier dans la rue !", description: "Vous perdez 20€", effect: "-20", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "lose30", image: "images/cards/loose30.png", title: "T'as oublié l'anniversaire de ta mère !", description: "Vous perdez 30€", effect: "-30", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "brokenglass", image: "images/cards/borken-glass.png", title: "T'as deux mains gauches ? Attention les verres !", description: "Tu rembourses un verre cassé, valeur 10€", effect: "-10", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "lownight", image: "images/cards/lownight.png", title: "C'est mort ce soir ! Personne dans le rad !", description: "Tu perds 50€", effect: "-50", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "flood", image: "images/cards/flood.png", title: "Soirée piscine ! Enfin soirée plomberie surtout !", description: "Tu perds 40€", effect: "-40", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "robber", image: "images/cards/robber.png", title: "Il a tapé dans la caisse !", description: "On t'as volé 60€", effect: "-60", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "tomuch", image: "images/cards/tomuch.png", title: "Un p'tit dernier pour la route !", description: "Le verre de trop, amande de 80€", effect: "-80", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "somethingiswrong", image: "images/cards/somethingiswrong.png", title: "Tu ne sais pas rendre la monnaie !", description: "Tu rends 20€ de trop a un client chanceux !", effect: "-20", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "rebuild", image: "images/cards/rebuild.png", title: "On refait la déco !", description: "Rénove ton bar pour la modique somme de 50€", effect: "-50", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "shortage", image: "images/cards/shortage.png", title: "Dévalisé !", description: "Tu t'es fait dévaliser, plus rien en stock", effect: "100", sound: "winner" });
|
||||
var obj = initCard(ctx, { _id: "luckyday", image: "images/cards/luckyday.png", title: "C'est un billet de 10 non ?", description: "Tu trouves 10€ devant ton bar", effect: "10", sound: "winner" });
|
||||
var obj = initCard(ctx, { _id: "rushhour", image: "images/cards/rushhour.png", title: "C'est la folie dans ton bar !", description: "Tu gagnes 50€ !", effect: "50", sound: "winner" });
|
||||
var obj = initCard(ctx, { _id: "blindtest", image: "images/cards/blindtest.png", title: "Tu gagnes la soirée blind test !", description: "Premier prix 20€ !", effect: "20", sound: "winner" });
|
||||
var obj = initCard(ctx, { _id: "bigtip", image: "images/cards/bigtip.png", title: "Tes clients t'adores !", description: "20€ de pourboire !", effect: "20", sound: "winner" });
|
||||
var obj = initCard(ctx, { _id: "baroftheweek", image: "images/cards/baroftheweek.png", title: "Tu gagnes le concours du bar de la semaine !", description: "Premier prix 50€ !", effect: "50", sound: "winner" });
|
||||
var obj = initCard(ctx, { _id: "goodnight", image: "images/cards/goodnight.png", title: "On t'en a trop rendus !", description: "Tu gagnes 30€ !", effect: "30", sound: "winner" });
|
||||
var obj = initCard(ctx, { _id: "yourdadishere", image: "images/cards/yourdadishere.png", title: "Ton père est là ! Paye une tournée de plus !", description: "Payer 30€ de plus !", effect: "-30", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "dontdrive", image: "images/cards/dontdrive.png", title: "Le ballon a dit non !", description: "Paye un taxi pour rentrer 10€ !", effect: "-10", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "flambeur", image: "images/cards/flambeur.png", title: "Tournée générale !", description: "Paye 60€ !", effect: "-60", sound: "looser" });
|
||||
var obj = initCard(ctx, { _id: "cuteashell", image: "images/cards/cuteashell.png", title: "Tu es de toute beauté !", description: "On t'offres 40€ !", effect: "40", sound: "winner" });
|
||||
var obj = initCard(ctx, { _id: "loseitall", image: "images/cards/loseitall.png", title: "Tu as oublié ton portefeuille !", description: "Tu perds 50€ !", effect: "-50", sound: "looser" });
|
||||
|
||||
// Tiletype
|
||||
var obj = initTiletype(ctx, { _id: "bar", description: "bar" });
|
||||
var obj = initTiletype(ctx, { _id: "meetup", description: "Rencontre" });
|
||||
var obj = initTiletype(ctx, { _id: "happyHour", description: "Happy Hour" });
|
||||
var obj = initTiletype(ctx, { _id: "prison", description: "Cellule de dégrisement"});
|
||||
var obj = initTiletype(ctx, { _id: "start", description: "Week-end"});
|
||||
|
||||
// Titlelevel
|
||||
var obj = initTilelevel(ctx, { _id: "pmu", order: 1, description: "PMU" });
|
||||
var obj = initTilelevel(ctx, { _id: "bistro", order: 2, description: "Bistro de quartien"});
|
||||
var obj = initTilelevel(ctx, { _id: "brasserie", order: 3, description: "Brasserie" });
|
||||
var obj = initTilelevel(ctx, { _id: "barabiere", order: 4, description: "Bar à bières" });
|
||||
var obj = initTilelevel(ctx, { _id: "baravin", order: 5, description: "Bar à vin" });
|
||||
var obj = initTilelevel(ctx, { _id: "cocktails", order: 6, description: "Bar a cocktails" });
|
||||
var obj = initTilelevel(ctx, { _id: "lounge", order: 7, description: "Lounge" });
|
||||
var obj = initTilelevel(ctx, { _id: "clubprive", order: 8, description: "Club privé" });
|
||||
|
||||
// Case
|
||||
var obj = initTile(ctx, { _id: "st", position: 0, tiletype: "start", name: "Week-end", img: "https://static.actu.fr/uploads/2017/05/rue-de-la-soif-Rennes-960x640.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b1", position: 1, tiletype: "bar", name: "Les hirondelles", prixDeBase: "1", img: "https://media-cdn.tripadvisor.com/media/photo-s/08/99/ef/5a/les-hirondelles.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b2", position: 2, tiletype: "bar", name: "Le cheval blanc", prixDeBase: "1", img: "https://media-cdn.tripadvisor.com/media/photo-s/14/f4/ed/0f/le-cheval-blanc.jpg" });
|
||||
var obj = initTile(ctx, { _id: "meetup1", position: 3, tiletype: "meetup", name: "Rencontre", img: "https://hoptodate.com/wp-content/uploads/2022/10/Depositphotos_331369428_XL-scaled.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b3", position: 4, tiletype: "bar", name: "L'ABC", prixDeBase: "2", img: "https://www.pagesjaunes.fr/media/agc/52/85/77/00/00/d1/00/ab/e8/ca/62bc5285770000d100abe8ca/62bc5285770000d100abe8cc.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b4", position: 5, tiletype: "bar", name: "La taverne", prixDeBase: "2", img: "https://www.clamecyhautnivernais-tourisme.fr/wp-content/uploads/wpetourisme/Bar-La-Taverne-Clamecy----D.Data-900x535.jpg" });
|
||||
var obj = initTile(ctx, { _id: "hh1", position: 6, tiletype: "happyHour", name: "Happy hour", img: "https://blog.laddition.com/sites/default/files/2022-03/sans-titre-17_0.png" });
|
||||
var obj = initTile(ctx, { _id: "b6", position: 7, tiletype: "bar", name: "La fine mousse", prixDeBase: "3", img: "https://cdn.eat-list.fr/establishment/photo/gallery_photo/75011-paris-11/la-fine-mousse_91615_c4c.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b7", position: 8, tiletype: "bar", name: "Le barboteur", prixDeBase: "3", img: "https://storage.googleapis.com/statics-wp/sites/lebarboteurlille.com/Le-Barboteur-0-1-1.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b7", position: 9, tiletype: "bar", name: "Le palais de la bière", prixDeBase: "3", img: "https://www.tourisme-pontaudemer-rislenormande.com/wp-content/uploads/2017/03/Palais-de-la-bi%C3%A8re.jpeg" });
|
||||
var obj = initTile(ctx, { _id: "meetup2", position: 10, tiletype: "meetup", name: "Rencontre", img: "https://www.monpetitdate.fr/wp-content/uploads/2022/01/rencontre-trans-paris.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b8", position: 11, tiletype: "bar", name: "Le comptoir des bières", prixDeBase: "4", img: "https://lh3.googleusercontent.com/p/AF1QipPRj-YgeXsNxXjkpxill-QMSh20T9jeNl8OLcuj=s1600-w640" });
|
||||
var obj = initTile(ctx, { _id: "b9", position: 12, tiletype: "bar", name: "Les moulins bleus", prixDeBase: "4", img: "https://www.brunnenbraeu.org/Alben2/MoulinsBleusDijon/album/slides/Les%20Moulins%20Bleus%20%E2%80%93%20Craft%20Beer%20and%20Food%20%281%29.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b10", position: 13, tiletype: "bar", name: "Le fourquet", prixDeBase: "4", img: "https://media-cdn.tripadvisor.com/media/photo-s/0c/ce/ca/87/le-fourquet.jpg" });
|
||||
var obj = initTile(ctx, { _id: "prs", position: 14, tiletype: "prison", name: "Cellule de dégrisement", img: "https://lvdneng.rosselcdn.net/sites/default/files/dpistyles_v2/ena_16_9_extra_big/2022/09/05/node_1224621/55601340/public/2022/09/05/B9732002324Z.1_20220905182824_000%2BGBHL6LBT5.1-0.jpg?itok=UqmdxUiM1662450019" });
|
||||
var obj = initTile(ctx, { _id: "b11", position: 15, tiletype: "bar", name: "Au beaux fûts", prixDeBase: "5", img: "https://because-gus.com/wp-content/uploads/2020/02/Bars-MaryRebeccaElliott.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b12", position: 16, tiletype: "bar", name: "Le Bacchus", prixDeBase: "5", img: "https://media-cdn.tripadvisor.com/media/photo-s/10/f6/a8/75/facade.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b13", position: 17, tiletype: "bar", name: "Matusalém", prixDeBase: "5", img: "https://foodforthought.com.my/wp-content/uploads/Franks-Bar-Matusalem-Rum-x-Franks-Food-For-Thought-1024x731.jpeg" });
|
||||
var obj = initTile(ctx, { _id: "meetup3", position: 18, tiletype: "meetup", name: "Rencontre", img: "https://test.psychologies.com/var/tests/storage/images/2/3/3/1/11332-2-fre-FR/Test-pret-rencontre_thumb_434_265.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b14", position: 19, tiletype: "bar", name: "Bloody Marianne", prixDeBase: "6", img: "https://lh3.googleusercontent.com/p/AF1QipPAS0edvVXEiY7_ttg_wBIegJs1Nz2lxIXmqmr3=s1600-w640" });
|
||||
var obj = initTile(ctx, { _id: "b15", position: 20, tiletype: "bar", name: "Shake it up", prixDeBase: "6", img: "https://images.barrons.com/im-839994?width=700&height=466" });
|
||||
var obj = initTile(ctx, { _id: "b16", position: 21, tiletype: "bar", name: "Le mixologue", prixDeBase: "6", img: "https://www.ciga.fr/img/cms/le-mixologue/mise-en-situation-le-mixologue.jpg" });
|
||||
var obj = initTile(ctx, { _id: "hh2", position: 22, tiletype: "happyHour", name: "Happy hour", img: "https://img.freepik.com/vecteurs-libre/fond-dessin-anime-happy-hours_52683-81243.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b17", position: 23, tiletype: "bar", name: "Le senateur", prixDeBase: "7", img: "https://media-cdn.tripadvisor.com/media/photo-s/0f/72/99/b4/montreal-marriott-chateau.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b18", position: 24, tiletype: "bar", name: "La dame blanche", prixDeBase: "7", img: "https://decibelles-data.media.tourinsoft.eu/upload/dame-jour.jpeg" });
|
||||
var obj = initTile(ctx, { _id: "meetup4", position: 25, tiletype: "meetup", name: "Rencontre", img: "https://www.commeuncamion.com/content/uploads/2015/08/Rencontre-Couple-Bar.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b19", position: 26, tiletype: "bar", name: "Le Kube", prixDeBase: "8", img: "https://www.lesbarres.com/media/image/slideshow/726a6f8ea266c7c0cbb72cbc261d3520bf8f90df.jpg" });
|
||||
var obj = initTile(ctx, { _id: "b20", position: 27, tiletype: "bar", name: "L'amirauté", prixDeBase: "8", img: "https://www.lamiraute-restaurant-saintes-maries-de-la-mer.com/media/cache/resolve/l800/websites/b510beeb640a5dc50a78118b3c8f7ce2/img/restaurant-amiraute-saintes-maries-de-la-mer-04_20210927172840.jpg" });
|
||||
}
|
||||
|
||||
// La fonction "onInit()" (si déclarée) est automatiquement
|
||||
@ -40,6 +111,7 @@ function onInit() {
|
||||
rpc.register("initCard");
|
||||
|
||||
rpc.register("getTile");
|
||||
rpc.register("getTilebyorder");
|
||||
rpc.register("upsertTile");
|
||||
rpc.register("initTile");
|
||||
|
||||
@ -63,7 +135,7 @@ function onInit() {
|
||||
rpc.register("upsertPlayer");
|
||||
|
||||
rpc.register("getPlayerParty");
|
||||
rpc.register("upsertlayerParty");
|
||||
rpc.register("upsertPlayerParty");
|
||||
|
||||
rpc.register("getPlayerPartyTile");
|
||||
rpc.register("upsertlayerPartyTile");
|
||||
@ -134,8 +206,12 @@ async function getTile(ctx,id) {
|
||||
if(obj&&!obj.value) obj.value=obj.default;
|
||||
return obj;
|
||||
}
|
||||
async function upsertTile(ctx,card) {
|
||||
var obj = await store.upsert(ctx, "Tile", config);
|
||||
async function getTilebyorder(ctx,position) {
|
||||
var obj = await store.query(ctx, "Tile",{"eq":{ "position": position }},);
|
||||
return obj[0];
|
||||
}
|
||||
async function upsertTile(ctx,tile) {
|
||||
var obj = await store.upsert(ctx, "Tile", tile);
|
||||
return obj;
|
||||
}
|
||||
function initTile(ctx,tile) {
|
||||
@ -165,8 +241,8 @@ async function getTilelevel(ctx,id) {
|
||||
if(obj&&!obj.value) obj.value=obj.default;
|
||||
return obj;
|
||||
}
|
||||
async function upsertTilelevel(ctx,card) {
|
||||
var obj = await store.upsert(ctx, "Tilelevel", config);
|
||||
async function upsertTilelevel(ctx,titlelevel) {
|
||||
var obj = await store.upsert(ctx, "Tilelevel", titlelevel);
|
||||
return obj;
|
||||
}
|
||||
function initTilelevel(ctx,tilelevel) {
|
||||
@ -232,16 +308,16 @@ async function upsertPlayer(ctx,player) {
|
||||
}
|
||||
|
||||
// Repository PlayerParty
|
||||
async function getPlayerParty(ctx,playerid,partyid) {
|
||||
async function getPlayerParty(ctx,ids) {
|
||||
var obj = await store.query(ctx, "PlayerParty",
|
||||
{
|
||||
"and": [
|
||||
"eq":{ "playerid": playerid },
|
||||
"eq":{ "partyid": partyid }
|
||||
{"eq":{ "playerid": ids.playerid }},
|
||||
{"eq":{ "partyid": ids.partyid }}
|
||||
]
|
||||
}
|
||||
);
|
||||
return obj;
|
||||
return obj[0];
|
||||
}
|
||||
async function upsertPlayerParty(ctx,playerparty) {
|
||||
var obj = await store.upsert(ctx, "PlayerParty", playerparty);
|
||||
@ -249,17 +325,17 @@ async function upsertPlayerParty(ctx,playerparty) {
|
||||
}
|
||||
|
||||
// Repository PlayerPartyCase
|
||||
async function getPlayerPartyTile(ctx,playerid,partyid,Tileid) {
|
||||
async function getPlayerPartyTile(ctx,ids) {
|
||||
var obj = await store.query(ctx, "PlayerPartyTile",
|
||||
{
|
||||
"and": [
|
||||
"eq":{ "playerid": playerid },
|
||||
"eq":{ "partyid": partyid },
|
||||
"eq":{ "tileid": tileid },
|
||||
{"eq":{ "playerid": ids.playerid }},
|
||||
{"eq":{ "partyid": ids.partyid }},
|
||||
{"eq":{ "tileid": ids.tileid }}
|
||||
]
|
||||
}
|
||||
);
|
||||
return obj;
|
||||
return obj[0];
|
||||
}
|
||||
async function upsertPlayerPartyCase(ctx,playerpartycase) {
|
||||
var obj = await store.upsert(ctx, "PlayerPartyCase", playerpartycase);
|
||||
|
Reference in New Issue
Block a user