adonthell-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Adonthell-devel] A little Skill system check...


From: Nils Fohrbeck
Subject: Re: [Adonthell-devel] A little Skill system check...
Date: Tue, 04 Mar 2003 17:17:32 +0100


>Just for comparison, here's the skill check method I wrote some time
>ago. (Note that it only works for variable skill checks. The other sort
>can be easily made on the fly.)


Yours looks much better than mine (now I know the difference between good 
(small) code and bulky complicated code (I see some more practice is needed to 
increase my skill rank...)).

>
>    # -- tests whether a character's skill is high 
>    #    enough for the task at hand
>    #
>    #    rank:      character's rank in the skill to test
>    #    required:  number the character must beat to succeed
>    #    dice:      number of rolls the character has
>    #    faces:     number of sides the dice has
>    #
>    #    returns    1 if the character succeeds, 0 on failure
>    def probe (rank, required, dice = 1, faces = 6):
>        if faces < 2: faces = 2
>        
>        while dice > 0:
>            required = required - rank * random.randrange (1, faces, 1)
>            dice = dice - 1
>        
>        return (required <= 0)

Seriously though, I will try to come up with an easy rules system that is 
modular (meanig it can easily be extended), and which is easy to understand for 
the player. How hard will it be to implement the system with the existing 
release (so when you walk up to a door you must break the lock before you can 
open it?). Because even without fighting, jumping using skills and combining 
items should add a lot more interactivity!








reply via email to

[Prev in Thread] Current Thread [Next in Thread]