Menu

#10 More reasonable limits for "wear"

1.0
open
nobody
None
2020-07-15
2020-07-15
Lee Harr
No

Originally reported on Google Code with ID 19 ```

Currently it's possible for a player to wear an unlimited number of hats, armor, etc all at the same time which is not the ideal.

Besides realism, there's also the matter of convenience, in that it's practical to have to manually remove a hat to wear another, so in at least some cases, the system should assume that by equipping an item the player intends to remove another of the same type or position.

```

Reported by hello.jay.araujo on 2009-01-18 13:23:07
Comments (5)

Former user
Account Deleted

```

oops, I meant to say that "it's NOT practical".

```

Reported by `hello.jay.araujo` on 2009-01-18 13:24:51
    2009-01-18
Former user Account Deleted

```

Wear slots (position awareness) come to mind here as an obvious solution. Headgear would be wearable one at a time while something you use in your fingers or

as a pendant would not.

Again I'd strongly suggest using inheritance to make the system sane:

class ChestWearable(Wearable): max_wear = 1

class FingerWear(Wearable): max_wear = 0 # means infinity

class Armor(ChestWear): pass

class Ring(FingerWear): pass

```

Reported by `hello.jay.araujo` on 2009-01-18 13:49:38
    2009-01-18
Former user Account Deleted

```

oops, actually max_wear = 0 would be assigned in the base class Wearable and not in

FingerWear, as it is the default value for the type.

```

Reported by `hello.jay.araujo` on 2009-01-18 14:10:09
    2009-01-18
Former user Account Deleted

```

Here's a quick implementation of the aforementioned approach.

http://pastebin.com/m30f24ebc

```

Reported by `hello.jay.araujo` on 2009-01-18 16:17:41
    2009-01-18
Former user Account Deleted

``` That pastebin is not gone... Can you please attach here a file with it, instead? ```

Reported by `marcos.marado@optimus.pt` on 2010-12-29 16:23:54
    2010-12-29

Discussion


Log in to post a comment.