reshuffle hint system. You can always re-ask where something was for free. You can't go into debt now.
This commit is contained in:
		
							parent
							
								
									c4ba281645
								
							
						
					
					
						commit
						278d510551
					
				| 
						 | 
					@ -338,23 +338,29 @@ async def process_client_cmd(ctx : Context, client : Client, cmd, args):
 | 
				
			||||||
                                      f"A hint costs {ctx.hint_cost} points. "
 | 
					                                      f"A hint costs {ctx.hint_cost} points. "
 | 
				
			||||||
                                      f"You have {points_available} points.")
 | 
					                                      f"You have {points_available} points.")
 | 
				
			||||||
            elif itemname in Items.item_table:
 | 
					            elif itemname in Items.item_table:
 | 
				
			||||||
                if ctx.hint_cost: can_pay = points_available // ctx.hint_cost >= 1
 | 
					                hints = collect_hints(ctx, client.team, client.slot, itemname)
 | 
				
			||||||
                else: can_pay = True
 | 
					                found = 0
 | 
				
			||||||
 | 
					                for already_found, hint in hints:
 | 
				
			||||||
                if can_pay:
 | 
					                    found += 1 - already_found
 | 
				
			||||||
                    hints = collect_hints(ctx, client.team, client.slot, itemname)
 | 
					                if not found:
 | 
				
			||||||
                    found = 0
 | 
					 | 
				
			||||||
                    for already_found, hint in hints:
 | 
					                    for already_found, hint in hints:
 | 
				
			||||||
                        found += 1-already_found
 | 
					 | 
				
			||||||
                        notify_team(ctx, client.team, hint)
 | 
					                        notify_team(ctx, client.team, hint)
 | 
				
			||||||
                    ctx.hints_used[client.team, client.slot] += found
 | 
					                    notify_client(client, "No new items found, points refunded.")
 | 
				
			||||||
                    if not found:
 | 
					 | 
				
			||||||
                        notify_client(client, "No new items found, points refunded.")
 | 
					 | 
				
			||||||
                    else:
 | 
					 | 
				
			||||||
                        save(ctx)
 | 
					 | 
				
			||||||
                else:
 | 
					                else:
 | 
				
			||||||
                    notify_client(client, f"You can't afford the hint. "
 | 
					                    if ctx.hint_cost:
 | 
				
			||||||
                                          f"You have {points_available} points and need {ctx.hint_cost}")
 | 
					                        can_pay = points_available // (ctx.hint_cost * found) >= 1
 | 
				
			||||||
 | 
					                    else:
 | 
				
			||||||
 | 
					                        can_pay = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					                    if can_pay:
 | 
				
			||||||
 | 
					                        ctx.hints_used[client.team, client.slot] += found
 | 
				
			||||||
 | 
					                        for already_found, hint in hints:
 | 
				
			||||||
 | 
					                            notify_team(ctx, client.team, hint)
 | 
				
			||||||
 | 
					                        save(ctx)
 | 
				
			||||||
 | 
					                    else:
 | 
				
			||||||
 | 
					                        notify_client(client, f"You can't afford the hint. "
 | 
				
			||||||
 | 
					                                              f"You have {points_available} points and need  at least {ctx.hint_cost}, "
 | 
				
			||||||
 | 
					                                              f"more if multiple items are still be found.")
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
                notify_client(client, f'Item "{itemname}" not found.')
 | 
					                notify_client(client, f'Item "{itemname}" not found.')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue