Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8084713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:52:48+00:00 2026-06-05T17:52:48+00:00

I am making a pokemon game and this section is giving me 3 errors:

  • 0

I am making a pokemon game and this section is giving me 3 errors:
“Invalid expression term ‘;’ (CS1525)” and “; expected(CS1002)”

public class HeldItem
{
    public static int CritCalc(bool item,bool skill, bool UsedItem,int dmg)
    {
        Random rand=new Random();
        Action jump=new Action();
        int i = rand()%100;
        double CritPerc = 6.25;
        if(item==true)
            CritPerc=12.5;
        else if(skill==true)
            CritPerc=12.5;
        else if(UsedItem==true)
            CritPerc=12.5;
        else if((item==true & skill== true) || (item==true & UsedItem == true) || (skill==true & UsedItem==true))
                CritPerc=25%;
        else if(item==true & skill == true & UsedItem==true)
            CritPerc=33.3%;
        if(Action) //jump
            CritPerc = 50%;
        if(i<CritPerc)
            dmg=2*dmg;
        else if(i>CritPerc)
            dmg==dmg;
        return dmg; 
    }
}

}

Maybe it is a silly problem but I don’t know what it is

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:52:51+00:00Added an answer on June 5, 2026 at 5:52 pm

    You cannot specify percents in C#.

    You have the following lines:

    CritPerc=25%;
    CritPerc=33.3%;
    CritPerc = 50%;
    

    That is invalid (Percent indicates the modulo operator in C#).

    Instead, you probably want to specify the values as double floating point values.

    CritPerc=0.25;
    CritPerc=0.333;
    CritPerc = 0.50;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a pokemon like game that will utilize SQLite DBs for storage
I am making a top down, rpg-type game - similar to Pokemon, but I
Making my first steps in RIA Services (VS2010Beta2) and i encountered this problem: created
I´m making an Android App with a Google Map. This app must alert you
Im making a class that is supposed to be able to assign c-strings the
Making a new shooter game here in the vein of Galaga (my fav shooter
Does making a class field volatile prevent all memory visibility issues with it in
Making a new class in VS10 gives me using System; using System.Collections.Generic; using System.Linq;
Making an uno game for a project. all 108 cards are located in a
Making a game with OpenGL/GLUT and C++. I've heard the easiest way to manage

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.