コード例 #1
0
ファイル: inventory.py プロジェクト: the-Bruce/ALTANTIS
 async def trade(self, ctx, team, *args):
     """
     Begins a trade with <team>, where you offer item1 quantity1 item2 quantity2 and so on.
     For example: !trade team_name Fish 10 "Gold coin" 3
     """
     await perform_async(arrange_trade, ctx, get_team(ctx.channel), team,
                         list(args))
コード例 #2
0
ファイル: upgrades.py プロジェクト: the-Bruce/ALTANTIS
 async def upgrade(self, ctx, amount: int):
     """
     (CONTROL) Upgrades this team's reactor by <amount>.
     You can specify a negative number, but this will not check that the resulting state makes sense (that is, the team is not using more power than they have) - in general you should use !damage instead.
     """
     await perform_async_unsafe(upgrade_sub, ctx, get_team(ctx.channel),
                                amount)
コード例 #3
0
ファイル: inventory.py プロジェクト: the-Bruce/ALTANTIS
 async def pay(self, ctx, amount: int):
     """
     (CONTROL) Pays this team <amount> money. Shorthand for !give with currency name.
     """
     await perform_async_unsafe(give_item_to_team, ctx,
                                get_team(ctx.channel), CURRENCY_NAME,
                                amount)
コード例 #4
0
ファイル: movement.py プロジェクト: the-Bruce/ALTANTIS
 async def deactivate(self, ctx):
     """
     Deactivates your submarine, stopping it from moving and performing actions.
     Needed for docking.
     """
     await perform_async(set_activation, ctx, get_team(ctx.channel),
                         ctx.guild, False)
コード例 #5
0
ファイル: comms.py プロジェクト: finnbar/ALTANTIS
 async def broadcast(self, ctx, *message):
     """
     Broadcasts a <message> to all in range. Requires the sub to be activated.
     Note that this can be provided in quotes or not - we consume all arguments.
     """
     await perform_async(broadcast, ctx, get_team(ctx.channel),
                         " ".join(message))
コード例 #6
0
ファイル: inventory.py プロジェクト: the-Bruce/ALTANTIS
 async def get_paid(self, ctx, amount: int):
     """
     (CONTROL) Get paid by this team <amount> money. Shorthand for !take with currency name. Do not use this during a trade.
     """
     await perform_async_unsafe(take_item_from_team, ctx,
                                get_team(ctx.channel), CURRENCY_NAME,
                                amount)
コード例 #7
0
ファイル: upgrades.py プロジェクト: the-Bruce/ALTANTIS
 async def upgrade_innate(self, ctx, system, amount: int):
     """
     (CONTROL) Upgrades this team's innate system by <amount>.
     You can specify a negative number to downgrade, and it will check that this makes sense.
     """
     await perform_async_unsafe(upgrade_sub_innate, ctx,
                                get_team(ctx.channel), system, amount)
コード例 #8
0
ファイル: power.py プロジェクト: the-Bruce/ALTANTIS
 async def power(self, ctx, *systems):
     """
     Gives one power to all of <systems> (any number of systems, can repeat).
     Fails if this would overload the power.
     NOTE: This is cumulative - it acts based on all previous calls to this (before the game tick).
     """
     await perform(power_systems, ctx, get_team(ctx.channel), list(systems))
コード例 #9
0
 async def puzzle(self, ctx):
     """
     Gives you a puzzle, which must be solved before you next move. If you
     already have a puzzle in progress, it will be treated as if you ran out of
     time!
     """
     await perform_async(give_team_puzzle, ctx, get_team(ctx.channel), "repair")
コード例 #10
0
ファイル: power.py プロジェクト: the-Bruce/ALTANTIS
 async def unpower(self, ctx, *systems):
     """
     Removes one power from all of <systems> (any number of systems, can repeat).
     Fails if a system would have less than zero power.
     NOTE: This is cumulative - it acts based on all previous calls to this (before the game tick).
     """
     await perform(unpower_systems, ctx, get_team(ctx.channel),
                   list(systems))
コード例 #11
0
ファイル: upgrades.py プロジェクト: the-Bruce/ALTANTIS
 async def add_keyword(self,
                       ctx,
                       keyword,
                       turn_limit: Optional[int] = None,
                       damage: int = 1):
     """
     (CONTROL) Gives this team a brand new <keyword>! (This is for upgrades outside of power.)
     """
     await perform_async_unsafe(add_keyword_to_sub, ctx,
                                get_team(ctx.channel), keyword, turn_limit,
                                damage)
コード例 #12
0
ファイル: inventory.py プロジェクト: the-Bruce/ALTANTIS
 async def take(self, ctx, item, quantity: int = 1):
     """
     (CONTROL) Take <quantity> of <item> away from this team. Do not use this during a trade.
     """
     await perform_async_unsafe(take_item_from_team, ctx,
                                get_team(ctx.channel), item, quantity)
コード例 #13
0
ファイル: movement.py プロジェクト: the-Bruce/ALTANTIS
 async def activate(self, ctx):
     """
     Activates your submarine, allowing it to move and do actions in real-time.
     """
     await perform_async(set_activation, ctx, get_team(ctx.channel),
                         ctx.guild, True)
コード例 #14
0
ファイル: inventory.py プロジェクト: the-Bruce/ALTANTIS
 async def give(self, ctx, item, quantity: int = 1):
     """
     (CONTROL) Gives this team an <item> with optional <quantity>.
     """
     await perform_async_unsafe(give_item_to_team, ctx,
                                get_team(ctx.channel), item, quantity)
コード例 #15
0
ファイル: inventory.py プロジェクト: the-Bruce/ALTANTIS
 async def interact(self, ctx, arg=None):
     """
     Some NPCs will ask you to call this.
     """
     await perform_async(sub_interacts, ctx, get_team(ctx.channel), arg)
コード例 #16
0
ファイル: inventory.py プロジェクト: the-Bruce/ALTANTIS
 async def reject_trade(self, ctx):
     """
     Rejects and ends the current trade.
     """
     await perform_async(reject_offer, ctx, get_team(ctx.channel))
コード例 #17
0
 async def crane(self, ctx):
     """
     Drops the crane in your current location. Takes two turns to resolve.
     """
     await perform(drop_crane, ctx, get_team(ctx.channel))
コード例 #18
0
 async def status(self, ctx):
     """
     Reports the status of the submarine, including power and direction.
     """
     await perform(get_status, ctx, get_team(ctx.channel), main_loop)
コード例 #19
0
ファイル: movement.py プロジェクト: the-Bruce/ALTANTIS
 async def exit_sub(self, ctx):
     """
     Allows crew to leave a sub. Call only while you are docked.
     """
     await perform_async(exit_submarine, ctx, get_team(ctx.channel),
                         ctx.guild)
コード例 #20
0
ファイル: inventory.py プロジェクト: the-Bruce/ALTANTIS
 async def drop(self, ctx, item):
     """
     Drops the item specified by <item>. You cannot drop key items (those ending in *).
     """
     await perform(drop_item, ctx, get_team(ctx.channel), item)
コード例 #21
0
ファイル: power.py プロジェクト: the-Bruce/ALTANTIS
 async def heal(self, ctx, amount: int, reason=""):
     """
     (CONTROL) Forces this team to take <amount> healing at next loop. You can optionally specify a <reason> which will be messaged to them before.
     """
     await perform_async(heal_up, ctx, get_team(ctx.channel), amount,
                         reason)
コード例 #22
0
ファイル: danger.py プロジェクト: the-Bruce/ALTANTIS
 async def death(self, ctx, subname):
     """
     Kills your submarine. This isn't a joke. Must be called with your submarine's full name.
     """
     await perform_async(kill_sub, ctx, get_team(ctx.channel), subname)
コード例 #23
0
ファイル: comms.py プロジェクト: the-Bruce/ALTANTIS
 async def broadcast(self, ctx, message):
     """
     Broadcasts a <message> to all in range. Requires the sub to be activated.
     """
     await perform_async(broadcast, ctx, get_team(ctx.channel), message)
コード例 #24
0
 async def shoot_stunning(self, ctx, x: int, y: int):
     """
     Schedules a nondamaging shot at (<x>, <y>). This uses two weapons charges.
     """
     await perform(schedule_shot, ctx, x, y, get_team(ctx.channel), False)
コード例 #25
0
 async def add_npc(self, ctx, npctype, x: int, y: int):
     """
     (CONTROL) Add an NPC <npcname> of <npctype> to the map at (<x>, <y>).
     """
     await perform_unsafe(add_npc_to_map, ctx, npctype, x, y,
                          get_team(ctx.channel))
コード例 #26
0
ファイル: inventory.py プロジェクト: the-Bruce/ALTANTIS
 async def offer(self, ctx, *args):
     """
     Makes a counteroffer in your current trade, of form item1 quantity1 item2 quantity2...
     For example: !offer Fish 10 "Gold coin" 4
     """
     await perform_async(make_offer, ctx, get_team(ctx.channel), list(args))
コード例 #27
0
 async def map(self, ctx):
     """
     Shows a map of the world, including your submarine!
     """
     await perform_async(print_map, ctx, get_team(ctx.channel))
コード例 #28
0
ファイル: inventory.py プロジェクト: the-Bruce/ALTANTIS
 async def accept_trade(self, ctx):
     """
     Accepts the current trade. A trade will only complete once both parties have accepted the trade.
     """
     await perform_async(accept_offer, ctx, get_team(ctx.channel))
コード例 #29
0
 async def scan(self, ctx):
     """
     Repeats the scan message sent at the start of the current tick.
     """
     await perform(get_scan, ctx, get_team(ctx.channel))
コード例 #30
0
ファイル: comms.py プロジェクト: the-Bruce/ALTANTIS
 async def control_message(self, ctx, message):
     """
     (CONTROL) Sends to this team the message <message>, regardless of distance.
     """
     await perform_async_unsafe(shout_at_team, ctx, get_team(ctx.channel),
                                message)