Skip to content

Commit

Permalink
Cooker almost finished, add_ressource needed
Browse files Browse the repository at this point in the history
  • Loading branch information
PottierLoic committed May 3, 2023
1 parent 0ca2235 commit 87efe71
Show file tree
Hide file tree
Showing 9 changed files with 333 additions and 34 deletions.
18 changes: 7 additions & 11 deletions Assets/Prefabs/first_island_lvl_0.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1937170048647426601}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -6.49, y: -20.27, z: -0.17918336}
m_LocalPosition: {x: -6.49, y: -20.27, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down Expand Up @@ -475,7 +475,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4097405453929137453}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 4.97, y: -2.12, z: -0.17918336}
m_LocalPosition: {x: 4.97, y: -2.12, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
Expand Down Expand Up @@ -1117,7 +1117,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4097405454792798534}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -6.49, y: -20.27, z: -0.17918336}
m_LocalPosition: {x: -6.49, y: -20.27, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down Expand Up @@ -1191,12 +1191,8 @@ MonoBehaviour:
island: {fileID: 0}
milk: 0
wheat: 0
dest_x: 0
dest_y: 0
dest: main_island
loading: 0
unloading: 0
charge_time: 0
--- !u!1 &4097405454852465990
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1293,7 +1289,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4097405454939663184}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.51345587, y: 2.0260568, z: -0.17918336}
m_LocalPosition: {x: 0.51345587, y: 2.0260568, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down Expand Up @@ -5075,7 +5071,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4744746314585206025}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 14.01, y: 0.03, z: 0.3262971}
m_LocalPosition: {x: 14.01, y: 0.03, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down Expand Up @@ -6171,7 +6167,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5337266473315926299}
m_LocalRotation: {x: 0, y: 0, z: 0.7071068, w: 0.7071068}
m_LocalPosition: {x: -1.97, y: -11.12, z: -0.17918336}
m_LocalPosition: {x: -1.97, y: -11.12, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down Expand Up @@ -7068,7 +7064,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1763657924188134904, guid: b2cebea9201a49c4c99c82f1770359e0, type: 3}
propertyPath: m_LocalPosition.z
value: -0.0453434
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1763657924188134904, guid: b2cebea9201a49c4c99c82f1770359e0, type: 3}
propertyPath: m_LocalRotation.w
Expand Down
14 changes: 7 additions & 7 deletions Assets/Prefabs/first_island_lvl_1.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1724601824574208161}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 14.01, y: 0.03, z: 0.3262971}
m_LocalPosition: {x: 14.01, y: 0.03, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down Expand Up @@ -1202,7 +1202,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1882750121936285204}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -6.76, y: -20.59, z: -0.17918336}
m_LocalPosition: {x: -6.76, y: -20.59, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down Expand Up @@ -1306,7 +1306,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2099729064599697433}
m_LocalRotation: {x: -0, y: -0, z: 0.7071068, w: 0.7071068}
m_LocalPosition: {x: -1.97, y: -11.12, z: -0.1791834}
m_LocalPosition: {x: -1.97, y: -11.12, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
Expand Down Expand Up @@ -2535,7 +2535,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6611844899108546419}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.5134559, y: 2.026057, z: -0.1791834}
m_LocalPosition: {x: 0.5134559, y: 2.026057, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down Expand Up @@ -6211,7 +6211,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7098300313482743669}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -6.72, y: -20.54, z: -0.17918336}
m_LocalPosition: {x: -6.72, y: -20.54, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down Expand Up @@ -6246,7 +6246,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 9123523905261510268}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 4.97, y: -2.12, z: -0.1791834}
m_LocalPosition: {x: 4.97, y: -2.12, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children:
Expand Down Expand Up @@ -7465,7 +7465,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1763657924188134904, guid: b2cebea9201a49c4c99c82f1770359e0, type: 3}
propertyPath: m_LocalPosition.z
value: -0.0453434
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1763657924188134904, guid: b2cebea9201a49c4c99c82f1770359e0, type: 3}
propertyPath: m_LocalRotation.w
Expand Down
6 changes: 4 additions & 2 deletions Assets/Prefabs/main_island_lvl_1.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: baf9fc9d5fdeb4248b4edc19fd297448, type: 3}
m_Name:
m_EditorClassIdentifier:
recipeData: {fileID: 0}
recipe_cooker_1:
cooker_1_started: 0
timer_cooker_1: 0
--- !u!1 &4097405454939663184
GameObject:
m_ObjectHideFlags: 0
Expand All @@ -89,7 +91,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4097405454939663184}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.51345587, y: 2.0260568, z: -0.17918336}
m_LocalPosition: {x: 0.51345587, y: 2.0260568, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
Expand Down
64 changes: 64 additions & 0 deletions Assets/Scenes/world.unity
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,26 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1953892273274442872, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5235731011379260556, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6091835448738017240, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6091835449678301691, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6091835449883853223, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6091835450340973493, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalPosition.x
value: -12
Expand All @@ -505,6 +525,14 @@ PrefabInstance:
propertyPath: m_LocalPosition.y
value: -18.2
objectReference: {fileID: 0}
- target: {fileID: 6091835450340973493, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6585215393780500903, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7806537632569708463, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_RootOrder
value: 1
Expand Down Expand Up @@ -553,6 +581,42 @@ PrefabInstance:
propertyPath: m_Name
value: world
objectReference: {fileID: 0}
- target: {fileID: 8543694321307632588, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627745438224079697, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8627745438224079697, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627745438224079697, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8627745438224079697, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9007973793175949490, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 9007973793175949490, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9007973793175949490, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 9007973793175949490, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents:
- {fileID: 6091835450340973481, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
- {fileID: 6592868212638920006, guid: 50c2bce539372724abc1677ad7010bca, type: 3}
Expand Down
91 changes: 85 additions & 6 deletions Assets/Scripts/character.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,103 @@
public class character : MonoBehaviour
{

public int prestige = 0;
public int gold = 0;

// ressources
public int wheat = 0;
public int carrot = 0;
public int tomato = 0;
public int corn = 0;
public int eggplant = 0;
public int cabbage = 0;
public int salad = 0;
public int pumpkin = 0;
public int pickle = 0;
public int radish = 0;
public int sugar_cane = 0;

// animals
public int milk = 0;
public int eggs = 0;
public int wool = 0;
public int honey = 0;

public int prestige = 0;

public void remove_ressource(string ressource_name, int amount){
// materials
public int wood = 0;
public int stone = 0;
public int iron = 0;

// mid products
public int flour = 0;
public int sugar = 0;

public void change_ressource(string ressource_name, int amount){
switch (ressource_name)
{
// switch case for all ressources
case "gold":
gold -= amount;
gold += amount;
break;
case "wheat":
wheat -= amount;
wheat += amount;
break;
case "carrot":
carrot += amount;
break;
case "tomato":
tomato += amount;
break;
case "corn":
corn += amount;
break;
case "eggplant":
eggplant += amount;
break;
case "cabbage":
cabbage += amount;
break;
case "salad":
salad += amount;
break;
case "pumpkin":
pumpkin += amount;
break;
case "pickle":
pickle += amount;
break;
case "radish":
radish += amount;
break;
case "sugar_cane":
sugar_cane += amount;
break;
case "milk":
milk -= amount;
milk += amount;
break;
case "eggs":
eggs += amount;
break;
case "wool":
wool += amount;
break;
case "honey":
honey += amount;
break;
case "wood":
wood += amount;
break;
case "stone":
stone += amount;
break;
case "iron":
iron += amount;
break;
case "flour":
flour += amount;
break;
case "sugar":
sugar += amount;
break;
default:
break;
Expand Down
Loading

0 comments on commit 87efe71

Please sign in to comment.