Skip to content

Commit

Permalink
Fixing the untested issues
Browse files Browse the repository at this point in the history
The issues were having to cast my enum pick to int.
Also Stage function used local variable stage which conflicted with global variable stage.
  • Loading branch information
KoleckOLP committed Apr 14, 2021
1 parent bdd0679 commit ae2e5dc
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 40 deletions.
42 changes: 21 additions & 21 deletions Assets/MainScript.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class MainScript : MonoBehaviour
public int lose = 0;
public int stage = 1;

enum pick{
private enum pick{
rock=1, paper=2, scissors=3
}

Expand Down Expand Up @@ -98,22 +98,22 @@ private void GameResult(int stage){
}
}

private void Stage(int stage){
private void Stage(int stg){
if(videoname == $"{stage}_0_game.mp4"){ //Stage 1 vest
Random();
if(stage != 5){
if(stg != 5){
GameLayer(true); //Activates the GaySlayer (as for Soldat's request)
}
}
else if(videoname == $"{stage}_1_lose.mp4" || videoname == $"{stage}_1_lose.mp4" || videoname == $"{stage}_2_draw.mp4" || videoname == $"{stage}_3_lose.mp4" || videoname == $"{stage}_4_lose.mp4"){
PlayVid(Vn($"{stage}_0_game.mp4"));
else if(videoname == $"{stg}_1_lose.mp4" || videoname == $"{stg}_2_draw.mp4" || videoname == $"{stg}_3_lose.mp4" || videoname == $"{stg}_4_lose.mp4"){
PlayVid(Vn($"{stg}_0_game.mp4"));
}
else if(videoname == $"{stage}_5_win.mp4"){
else if(videoname == $"{stg}_5_win.mp4"){
lose = 0;
PlayVid(Vn($"{stage}_6_undress.mp4"));
PlayVid(Vn($"{stg}_6_undress.mp4"));
}
else if(videoname == $"{stage}_6_undress.mp4"){
stage = stage + 1;
else if(videoname == $"{stg}_6_undress.mp4"){
stage = stg + 1; //kinda ugly I hate it.
PlayVid(Vn($"{stage}_0_game.mp4"));
}
}
Expand Down Expand Up @@ -173,16 +173,16 @@ private void Draw_s(){
//==========ROCK==========
public void Click_rock(){ //1
GameLayer(false);
switch(pick){
case pick.rock:
switch(rando){
case (int)pick.rock:
Draw_s();
PlayVid(Vn("6_1_rock.mp4"));
break;
case pick.paper:
case (int)pick.paper:
Lose_s();
PlayVid(Vn("6_2_paper.mp4"));
break;
case pick.scissors:
case (int)pick.scissors:
Win_s();
PlayVid(Vn("6_3_scissors.mp4"));
break;
Expand All @@ -192,16 +192,16 @@ public void Click_rock(){ //1
//==========PAPER==========
public void Click_paper(){ //2
GameLayer(false);
switch(pick){
case pick.rock:
switch(rando){
case (int)pick.rock:
Win_s();
PlayVid(Vn("6_1_rock.mp4"));
break;
case pick.paper:
case (int)pick.paper:
Draw_s();
PlayVid(Vn("6_2_paper.mp4"));
break;
case pick.scissors:
case (int)pick.scissors:
Lose_s();
PlayVid(Vn("6_3_scissors.mp4"));
break;
Expand All @@ -211,16 +211,16 @@ public void Click_paper(){ //2
//==========SCISSORS==========
public void Click_scissors(){ //3
GameLayer(false);
switch(pick){
case pick.rock:
switch(rando){
case (int)pick.rock:
Lose_s();
PlayVid(Vn("6_1_rock.mp4"));
break;
case pick.paper:
case (int)pick.paper:
Win_s();
PlayVid(Vn("6_2_paper.mp4"));
break;
case scissors: // to test if it needs to be pick.type
case (int)pick.scissors: // to test if it needs to be pick.type
Draw_s();
PlayVid(Vn("6_3_scissors.mp4"));
break;
Expand Down
21 changes: 21 additions & 0 deletions Assets/txts/lol.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
private void Stage(int stg){
if(videoname == $"{stage}_0_game.mp4"){ //Stage 1 vest
Random();
if(stg != 5){
GameLayer(true); //Activates the GaySlayer (as for Soldat's request)
}
}
else if(videoname == $"{stg}_1_lose.mp4" || videoname == $"{stg}_1_lose.mp4" || videoname == $"{stg}_2_draw.mp4" || videoname == $"{stg}_3_lose.mp4" || videoname == $"{stg}_4_lose.mp4"){
PlayVid(Vn($"{stg}_0_game.mp4"));
}
else if(videoname == $"{stg}_5_win.mp4"){
Debug.Log("hit");
lose = 0;
PlayVid(Vn($"{stg}_6_undress.mp4"));
}
else if(videoname == $"{stg}_6_undress.mp4"){
Debug.Log("wanted hit");
stage = stg + 1; //kinda ugly I hate it.
PlayVid(Vn($"{stage}_0_game.mp4"));
}
}
7 changes: 7 additions & 0 deletions Assets/txts/lol.txt.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions Assets/txts/test.cs

This file was deleted.

0 comments on commit ae2e5dc

Please sign in to comment.