コード例 #1
0
ファイル: CraftItem.cs プロジェクト: xephnin/SWLOR_NWN
        private void HandleMainPageResponses(int responseID)
        {
            var model = _craft.GetPlayerCraftingData(GetPC());
            NWPlaceable device = GetDevice();

            switch (responseID)
            {
                case 1: // Examine Base Item
                    CraftBlueprint entity = _craft.GetBlueprintByID(model.BlueprintID);
                    NWPlaceable tempContainer = (_.GetObjectByTag("craft_temp_store"));
                    NWItem examineItem = (_.CreateItemOnObject(entity.ItemResref, tempContainer.Object));
                    GetPC().AssignCommand(() => _.ActionExamine(examineItem.Object));
                    examineItem.Destroy(0.1f);
                    break;
                case 2: // Create item
                    if (!model.CanBuildItem)
                    {
                        GetPC().FloatingText("You are missing some required components.");
                        return;
                    }

                    int effectiveLevel = _craft.CalculatePCEffectiveLevel(GetPC(), model.PlayerSkillRank, (SkillType)model.Blueprint.SkillID);
                    int difficulty = effectiveLevel - model.AdjustedLevel;

                    if(difficulty <= -5)
                    {
                        GetPC().FloatingText("It's impossible to make this item because its level is too high. Use lower-level components to reduce the level and difficulty.");
                        return;
                    }

                    _craft.CraftItem(GetPC(), device);
                    model.IsAccessingStorage = true;
                    EndConversation();
                    break;
                case 3: // Select main components
                    model.Access = CraftingAccessType.MainComponent;
                    OpenDeviceInventory();
                    break;
                case 4: // Select secondary components
                    model.Access = CraftingAccessType.SecondaryComponent;
                    OpenDeviceInventory();
                    break;
                case 5: // Select tertiary components
                    model.Access = CraftingAccessType.TertiaryComponent;
                    OpenDeviceInventory();
                    break;
                case 6: // Select enhancement components
                    model.Access = CraftingAccessType.Enhancement;
                    OpenDeviceInventory();
                    break;
                case 7: // Back (return to blueprint selection)
                    _craft.ClearPlayerCraftingData(GetPC());
                    SwitchConversation("CraftingDevice");
                    break;
            }
        }
コード例 #2
0
        private void HandleCraftItem(NWPlayer oPC, NWPlaceable device)
        {
            int            blueprintID = device.GetLocalInt("CRAFT_BLUEPRINT_ID");
            int            deviceID    = device.GetLocalInt("CRAFT_DEVICE_ID");
            CraftBlueprint pcBlueprint = _craft.GetBlueprintKnownByPC(oPC.GlobalID, blueprintID, deviceID);

            if (pcBlueprint == null)
            {
                oPC.FloatingText(_color.Red("You do not know that blueprint."));
                return;
            }

            _craft.CraftItem(oPC, device, blueprintID);
        }
コード例 #3
0
ファイル: CraftItem.cs プロジェクト: zunath/SolarOdyssey2_NWN
        private void HandleMainPageResponses(int responseID)
        {
            var         model  = _craft.GetPlayerCraftingData(GetPC());
            NWPlaceable device = GetDevice();

            switch (responseID)
            {
            case 1:     // Create item
                if (!model.CanBuildItem)
                {
                    GetPC().FloatingText("You are missing some required components.");
                    return;
                }

                _craft.CraftItem(GetPC(), device);
                EndConversation();
                break;

            case 2:     // Select main components
                model.Access = CraftingAccessType.MainComponent;
                OpenDeviceInventory();
                break;

            case 3:     // Select secondary components
                model.Access = CraftingAccessType.SecondaryComponent;
                OpenDeviceInventory();
                break;

            case 4:     // Select tertiary components
                model.Access = CraftingAccessType.TertiaryComponent;
                OpenDeviceInventory();
                break;

            case 5:
                model.Access = CraftingAccessType.Enhancement;
                OpenDeviceInventory();
                break;

            case 6:     // Back (return to blueprint selection)
                _craft.ClearPlayerCraftingData(GetPC());
                SwitchConversation("CraftingDevice");
                break;
            }
        }