Changeset 1595
- Timestamp:
- 06/23/08 12:56:52 (4 months ago)
- Files:
-
- branches/games/minionsofmirth/v1/testing/mud/world/core.py (modified) (1 diff)
- branches/games/minionsofmirth/v1/testing/mud/world/guardiancommand.py (modified) (2 diffs)
- branches/games/minionsofmirth/v1/testing/mud/world/immortalcommand.py (modified) (3 diffs)
- branches/games/minionsofmirth/v1/testing/mud/world/zone.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/games/minionsofmirth/v1/testing/mud/world/core.py
r1350 r1595 356 356 357 357 # Target is visible if it is casting or attacking, or if the mob 358 # has see invis or if the target's visibility is greater than 0.359 return (target.casting or target.attacking or mob.seeInvisible or 0 <target.visibility)358 # has see invis greater or equal to 1 minus the targets visibility. 359 return (target.casting or target.attacking or mob.seeInvisible >= 1.0 - target.visibility) 360 360 361 361 branches/games/minionsofmirth/v1/testing/mud/world/guardiancommand.py
r1197 r1595 193 193 194 194 195 def CmdInvis(mob, args): 196 # Initialize visibility command to toggle. 197 setInvis = mob.visibility > -100 198 199 # If there was an argument supplied, try to decipher its meaning. 200 if len(args): 201 argUpper = args[0].upper() 202 203 if argUpper == 'ON': 204 setInvis = True 205 elif argUpper == 'OFF': 206 setInvis = False 207 else: 208 mob.player.sendGameText(RPG_MSG_GAME_DENIED, \ 209 "Valid arguments are 'on' or 'off'. The argument can also be omitted to toggle.\\n") 210 return 211 212 # If the guardian wants to go invisible... 213 if setInvis: 214 # Run through all party members. 215 for c in mob.player.party.members: 216 # Check if we're already invisible enough. 217 # Check and modification have different values to have a safe margin 218 # for other effects modifying visibility. 219 if c.mob.visibility > -100: 220 c.mob.visibility -= 200 221 # And give feedback. 222 mob.player.sendGameText(RPG_MSG_GAME_GAINED,"GM invisibility enabled.\\n") 223 else: 224 # Run through all party members. 225 for c in mob.player.party.members: 226 # Check if we're already visible enough. 227 # Check and modification have different values to have a safe margin 228 # for other effects modifying visibility. 229 if c.mob.visibility <= -100: 230 c.mob.visibility += 200 231 # And give feedback. 232 mob.player.sendGameText(RPG_MSG_GAME_GAINED,"GM invisibility disabled.\\n") 233 234 235 195 236 COMMANDS = {} 196 237 COMMANDS['BAN'] = CmdBan … … 202 243 COMMANDS['CLEARFACTION'] = CmdClearFaction 203 244 COMMANDS['RESETFACTION'] = CmdClearFaction 245 COMMANDS['INVIS'] = CmdInvis 204 246 205 247 branches/games/minionsofmirth/v1/testing/mud/world/immortalcommand.py
r1594 r1595 580 580 itemname = argUpper 581 581 tomename = ' '.join(args[2:-1]) # strip "Tome of" and tome level 582 elif argUpper not in ("PLEVEL","SLEVEL","TLEVEL","SKILL","MONEY","XP","RENEW"," VISIBILITY","PRESENCE"):582 elif argUpper not in ("PLEVEL","SLEVEL","TLEVEL","SKILL","MONEY","XP","RENEW","PRESENCE"): 583 583 itemname = ' '.join(args) 584 584 else: … … 587 587 if len(args) > 1: 588 588 try: 589 if argUpper != "VISIBILITY": 590 levels = int(args[1]) 591 else: 592 levels = float(args[1]) 589 levels = int(args[1]) 593 590 except: 594 591 pass … … 669 666 670 667 mob.player.cinfoDirty = True 671 return672 elif itemname == 'VISIBILITY':673 if levels > 1.0:674 levels = 1.0675 mob.player.sendGameText(RPG_MSG_GAME_DENIED,"Max visibility modifier is 1.0!\\n")676 elif levels < 0.0:677 levels = 0.0678 mob.player.sendGameText(RPG_MSG_GAME_DENIED,"Min visibility modifier is 0.0!\\n")679 for c in mob.player.party.members:680 c.mob.visibility = levels681 668 return 682 669 elif itemname == 'TOME': branches/games/minionsofmirth/v1/testing/mud/world/zone.py
r1520 r1595 115 115 116 116 # announce to other players 117 if player.enteringWorld: 118 player.enteringWorld = False 119 for p in self.players: 120 p.sendGameText(RPG_MSG_GAME_BLUE,r'%s has entered the zone.\n'%player.charName) 121 for p in player.world.activePlayers: 122 if p == player: 123 continue 124 if p.enteringWorld: 125 continue 126 if p in self.players: #already told that we entered zone 127 continue 128 p.sendGameText(RPG_MSG_GAME_BLUE,r'%s has entered the world.\n'%player.charName) 129 else: 130 pmob = player.curChar.mob 131 for p in self.players: 132 if AllowHarmful(pmob,p.curChar.mob): 133 continue 134 p.sendGameText(RPG_MSG_GAME_BLUE,r'%s has entered the zone.\n'%player.charName) 117 if player.role.name not in ("Guardian","Immortal"): 118 if player.enteringWorld: 119 player.enteringWorld = False 120 for p in self.players: 121 p.sendGameText(RPG_MSG_GAME_BLUE, \ 122 r'%s has entered the zone.\n'%player.charName) 123 for p in player.world.activePlayers: 124 if p == player: 125 continue 126 if p.enteringWorld: 127 continue 128 if p in self.players: #already told that we entered zone 129 continue 130 p.sendGameText(RPG_MSG_GAME_BLUE, \ 131 r'%s has entered the world.\n'%player.charName) 132 else: 133 pmob = player.curChar.mob 134 for p in self.players: 135 if AllowHarmful(pmob,p.curChar.mob): 136 continue 137 p.sendGameText(RPG_MSG_GAME_BLUE, \ 138 r'%s has entered the zone.\n'%player.charName) 135 139 136 140

