Added baby Shiba + added heal boy function and choice window (needs to be implemented)

This commit is contained in:
2024-09-12 23:01:15 +02:00
parent eece543199
commit 9b3e7ecaa1
8 changed files with 60 additions and 11 deletions

19
main.js
View File

@@ -24,11 +24,6 @@ const animalImage = {
Dead: `./img/dead/${chosenAnimal}.png`,
Gone: `./img/gone/${chosenAnimal}.png`
}
////Spring: {},
////Summer: {},
////Fall: {},
////Winter: {},
}
let attributes = {
@@ -122,10 +117,10 @@ function toCPercen(varr){
}
function display(){
Dage.innerHTML = (attributes.Age.value);
Djoy.innerHTML = toCPercen(attributes.Joy);
Dfood.innerHTML = toCPercen(attributes.Hunger);
Dclean.innerHTML = toCPercen(attributes.Clean);
Dage.innerHTML = (attributes.Age.value);
Djoy.innerHTML = toCPercen(attributes.Joy);
Dfood.innerHTML = toCPercen(attributes.Hunger);
Dclean.innerHTML = toCPercen(attributes.Clean);
Dhealth.innerHTML = toCPercen(attributes.Hp);
if(attributes.Age.value<=6){
@@ -137,7 +132,7 @@ function display(){
}else if(attributes.Age.value<60){
NameC.innerHTML = `Adult`;
Aimg.src = animalImage.animal.Normal.age[2];
}else if(attributes.Age.value<100){
}else if(attributes.Age.value<attributes.Age.max){
NameC.innerHTML = `Senior`;
Aimg.src = animalImage.animal.Normal.age[3];
}else{
@@ -196,6 +191,10 @@ function clearBoy(){
display();
}
function healBoy(){
alert('Not enough money!');
}
function hapiHeal(){
if( attributes.Hunger.value > (attributes.Hunger.max/100)* 70 && //? Hunger heal
attributes.Joy.value > (attributes.Joy.max/100)* 80 && //? Joy heal