예제 #1
0

        
예제 #2
0
        void _buttonTakeAll_Press(object sender, PressEventArgs e)
        {
            for (int i = 0; i < _tradeItems.Count; i++)
            {
                int rightValue = rightTrader.getValue<int>(_tradeItems[i]);
                if (rightValue == 0)
                    continue;

                _offsets[i] = -rightValue;
            }
        }
예제 #3
0
 void _buttonCancel_Press(object sender, PressEventArgs e)
 {
     IntoTheNewWorld.Instance.Hide(this);
 }
예제 #4
0
        void _buttonOK_Press(object sender, PressEventArgs e)
        {
            if (_partnerAcceptsTrade)
            {
                // Save the left trader.
                for (int i = 0; i < _tradeItems.Count; i++)
                {
                    if (_offsets[i] == 0)
                        continue;

                    leftTrader.adjustValue(_tradeItems[i], -_offsets[i]);
                }

                // Save the right trader.
                for (int i = 0; i < _tradeItems.Count; i++)
                {
                    if (_offsets[i] == 0)
                        continue;

                    rightTrader.adjustValue(_tradeItems[i], _offsets[i]);
                }
            }

            // TODO: Handle other faction types.
            if (isAIPartner() && (_partner == TradingPartner.Native))
            {
                int native_like = IntoTheNewWorld.Instance.players[0].state.getValue<int>("native_like");
                if (_factionChange > 0)
                    IntoTheNewWorld.Instance.players[0].state.setValue("native_like", Math.Min(100, native_like + _factionChange));
                else
                    IntoTheNewWorld.Instance.players[0].state.setValue("native_like", Math.Max(-100, native_like + _factionChange));
            }

            IntoTheNewWorld.Instance.forceUpdateGameState = true;

            IntoTheNewWorld.Instance.Hide(this);
        }
예제 #5
0
 void _buttonOK_Press(object sender, PressEventArgs e)
 {
     this.baseGame.Hide(this);
 }