Difficulty-Based Character Class?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
Post Reply
User avatar
Gifty
Posts: 615
Joined: Sat Jun 15, 2013 8:21 pm

Difficulty-Based Character Class?

Post by Gifty »

Howdy! Was tinkering around with the skill level definition via MAPINFO, and I was wondering if there was a way to define/replace the player class based on the difficulty level one chooses. In this case, I'd like the Nightmare difficulty to entail a separate set of weapons, but I'm having trouble figuring out how to switch the player class via difficulty selection, rather than the traditional "player class select" menu. Any ideas?
User avatar
Matt
Posts: 9696
Joined: Sun Jan 04, 2004 5:37 pm
Preferred Pronouns: They/Them
Operating System Version (Optional): Debian Bullseye
Location: Gotham City SAR, Wyld-Lands of the Lotus People, Dominionist PetroConfederacy of Saudi Canadia
Contact:

Re: Difficulty-Based Character Class?

Post by Matt »

One possibility is to have the playerclass check and replace inventory items in its PostBeginPlay() state, something like

Code: Select all

class NotVerySuperMan:DoomPlayer
{
    default
    {
        player.displayname "Super Shotgun Guy";
        player.startitem "SuperShotgun";
        player.startitem "Fist";
        player.startitem "Shell", 20;
    }
    override void PostBeginPlay()
    {
        super.PostBeginPlay();
        if(skill>=3)
        {
            A_TakeInventory("SuperShotgun");
            A_GiveInventory("Shotgun");
            //might need another line to set # of shells
        }
    }
}
Post Reply

Return to “General”