Results 1 to 3 of 3

Thread: Simplest function to detect enemy creatures in the room?

  1. Default Simplest function to detect enemy creatures in the room?

    Any suggestions, or code, are appreciated.

    I've looked through bigshot a bit and it looks like I can obtain a NPC list for the room? Does that seem right? If I cycle through that list, is there a way to determine if an element is an offensive creature without comparing it to a list of target creatures?
    -----
    Looking for: Wearable wisdom enhancives (+5 and up)

  2. #2

    Default

    You can use aggressive type to look for critters that are aggressive.

    So you could do:

    target = GameObj.npcs.find { |npc| (npc.status !~ /dead/) && (npc.type =~ /aggressive/) }

    Which would set the variable "target" to be a critter in the room that isn't dead and also aggressive, this way you don't target a Ranger's companion or a Wizard's familiar.
    Last edited by Tgo01; 05-15-2019 at 12:48 AM.

  3. Default

    Perfect. Thanks!
    -----
    Looking for: Wearable wisdom enhancives (+5 and up)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •