lapsang-boys / Crimson-Chronicles

A self-proclaimed paradigm shifting tower defense map in Warcraft 3
4 stars 0 forks source link

Modify the system so it handles different difficulties #46

Closed godbit closed 6 years ago

godbit commented 6 years ago

At start of game/rmk set the a flag in PlayerData that stores that players difficulty.

In spawn use the mob for the current level that corresponds to the players chosen difficulty.

karlek commented 6 years ago

How about we update SquadMember:


// Probably in PlayerData.wurst
constant EASY = 0
constant NORMAL = 1
constant HARD = 2

// Squad.wurst
public class SquadMember
    int array u_ids
    int num
    SpawnPosition sp
    spawnInterval si

    construct(int array u_ids, int num, SpawnPosition sp, spawnInterval si)
        this.u_ids = u_ids
        this.num = num
        this.sp = sp
        this.si = si

    function getUnitDifficulty(int difficulty) returns int
        return this.u_ids[difficulty]

// Spawn.wurst
let u = createUnit(PLAYER_BROWN, single.getUnitDifficulty(pd.difficulty), pos, angle(PI/2))
karlek commented 6 years ago

Hmm, it will be quite the rewrite, but I'll think it will work.

Will affect:

Btw, I think we can remove the MobDefinitions STAG, since they aren't used anywhere apparently.

karlek commented 6 years ago
// Stag
for i = 0 to 3-1
    new MobDefinition(compiletime(UNIT_ID_GEN.next()), "Stag", Units.blackStagMale, "", 1, 1, scaleDifficulty(20, i), 0, 250, 1, 1.)

// Probably a better scaling function.
function scaleDifficulty(int hp, int difficulty) returns int
    return hp+hp*(0.1*difficulty)
godbit commented 6 years ago

Yeah looks good, i was thinking about something similar. Add this as a Zone 1 milestone?

karlek commented 6 years ago

:+1:

karlek commented 6 years ago

Closed in: cdfb804f82e1b2b8f33bea6163250bc3b86e952b