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 7018877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:06:33+00:00 2026-05-27T23:06:33+00:00

Assuming that I wanted to make a simple dos-based game and I wanted to

  • 0

Assuming that I wanted to make a simple dos-based game and I wanted to create some mobs, I’ve come up with the following rough object that I would need, and it looks something like this:

class createMob{ 
    private:
        int healthMax;
        int healthCurrent;
        int manaMax;
        int manaCurrent;
        int experiencePoints;

public:
    void setHealth();
    int getHealth();
    void setCurrentHealth();
    int getCurrentHealth();

    void setMaxMana();
    int getMaxMana();
    void setCurrentMana();
    int getCurrentMana();

    int getExperience();
//etc etc functions truncated for space


};

My question is how do I use this? Assume that I create a simple constructor to take in a hp / mp / experience for a mob called “green slime” (final fantasy theme going on here). My basic goal is to create a monster with x / y /z attributes and set them based on what happens in combat… What would be the easiest way to do this and then clean up efficiently afterwards?

  • 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-05-27T23:06:33+00:00Added an answer on May 27, 2026 at 11:06 pm

    If you have two mobs in a fight, the fight is going to take longer than one turn, so one fight turn is going to need the following global function:

    void fight(Mob &m1, Mob &m2, int fightstep);
    

    Now this function can change properties of both mobs. Now if mobs are actually doing some actions to choose how the fight is going, you’ll need something different:

    void fight(Mob &m1, Mob &m2, 
               std::vector<Action> vec1, std::vector<Action> vec2, 
               int fightstep);
    

    with the action being something like this:

    enum Action { EDoNothing, EBash, ECastSpellXXXX ... };
    

    Now the fight functions can use the interface of Mob class to do the changes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just wanted some input on a project that I'm working on. Basically, I'm
I wanted to create a linked-list data structure that was implemented in C. The
In java, if I wanted to create some application which could receive both doubles
Assuming that writing nhibernate mapping files is not a big issue....or polluting your domain
Assuming that I want to use a hash as an ID instead of a
assuming that I know the PID of a process and want to do a
Assuming that I have a CronTriggerBean similar to <bean id=midMonthCronTrigger class=org.springframework.scheduling.quartz.CronTriggerBean> <property name=jobDetail ref=reminderJobDetail
Assuming that best practices have been followed when designing a new database, how does
Assuming that I have a typedef declared in my .h file as such: typedef
Assuming that I know there is a git-daemon running at git://git.mycompany.com , how can

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.