Example #1
0
@mod_dep(Attitude, CharacterSpeaker)
class AttitudeChange(Entity):
    """Show message when attitude has changed"""
    @unbound
    def _load(self):
        self.add_listener_node('attitude', self.attitude_changed())
    
    @listener
    def attitude_changed(self, target, value):
        if value < 0:
            renpy.notify(_("{} is angry at you and won't work with such a bastard anymore!".format(self.name)))
            
            ## NOTE: this is preferred, but may cause "Cannot start an interaction in the middle of an interaction" error
            #self.speaker(_("I am angry at you! I won't work with such a bastard anymore!"))

Merc.global_mod(AttitudeChange)

class VisualEntity(Entity):
    @unbound
    def _init(self):
        self.dynamic_property('image')
        self.dynamic_property('visual_state', 'default')
        self.add_get_node('image', self.get_image())
    
    @depends('visual_state')
    @depends('id')
    @simplenode
    def get_image(value, visual_state, id):
        if not value:
            return id
        return value
Example #2
0
def world():
    pc_name = 'You'
    pc = Merc('pc')
    pc.name = pc_name
    world = HiredGunsWorld(pc)
    return world
Example #3
0
    @unbound
    def _load(self):
        self.add_listener_node('attitude', self.attitude_changed())

    @listener
    def attitude_changed(self, target, value):
        if value < 0:
            renpy.notify(
                _("{} is angry at you and won't work with such a bastard anymore!"
                  .format(self.name)))

            ## NOTE: this is preferred, but may cause "Cannot start an interaction in the middle of an interaction" error
            #self.speaker(_("I am angry at you! I won't work with such a bastard anymore!"))


Merc.global_mod(AttitudeChange)


class VisualEntity(Entity):
    @unbound
    def _init(self):
        self.dynamic_property('image')
        self.dynamic_property('visual_state', 'default')
        self.add_get_node('image', self.get_image())

    @depends('visual_state')
    @depends('id')
    @simplenode
    def get_image(value, visual_state, id):
        if not value:
            return id