13号避难所

 找回密码
 立即注册
搜索
查看: 1588|回复: 4
打印 上一主题 下一主题

请教两个脚本的参数...

[复制链接]
跳转到指定楼层
楼主
发表于 2019-7-18 19:01:04 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
这是别人的hs_calcapcost脚本,请教两个参数:
第一个是weapon_stat,这个脚本后面的参数是不是define_extra.h下的Item Common Flags里的?
我自己改了个脚本,结果发现这下面的参数似乎只有512(weapon_2hand)是正常,而3、4、48、64等等...x效果非常混乱...所以我想问问这些参数是能够正常生效的吗?我后来在完全一样的脚本上改用了武器动画进行判断(也就是这个脚本里面的weapon_stata),结果是没有问题...


第二个是ATKTYPE_RWEP1、2以及ATKTYPE_LWEP1、2,这两组的意思是否就是左手和右手武器的第一攻击状态和第二攻击状态?比如说以长矛举例,第一攻击状态就是穿刺,第二攻击状态就是投掷,而如果是邦瑟锤,第一攻击状态就是点射,第二攻击状态就是扫射?


第三个是我自己用这个脚本改了一下单枪客天赋(one_hand)的效果,目前来说效果是有了,但单枪客原本就有的+单手武器命中和-双手武器命中依然存在,有没有什么简单的办法能实现?实在不行我只能把ond_hand 消掉然后加个一样的假perk了...


#include "E:\Game Files\Fallout 2\HEADERS\sFall\sfall.h"

#include "E:\Game Files\Fallout 2\HEADERS\sFall\define_extra.h"

#include "E:\Game Files\Fallout 2\HEADERS\define.h"

#include "E:\Game Files\Fallout 2\HEADERS\Perk_Inc.h"

variable user;
variable attack_type;
variable aimed_or_not;
variable vanilla_ap_cost;
variable weapon_stat;
variable weapon_stata;
variable weapon_state;
variable expert_shooter_ap;
variable pri_weapon_used;
variable sec_weapon_used;
               
procedure start;
procedure Get_Skill_Right;
procedure Get_Skill_Left;

procedure start begin
        if(game_loaded) then begin
        end else begin
                user := get_sfall_arg;
                attack_type := get_sfall_arg;
                aimed_or_not := get_sfall_arg;
                vanilla_ap_cost := get_sfall_arg;
                sec_weapon_used := critter_inven_obj(dude_obj, INVEN_TYPE_LEFT_HAND);
                pri_weapon_used := critter_inven_obj(dude_obj, INVEN_TYPE_RIGHT_HAND);
                if has_fake_perk(ExpertShooter) then begin
                   //display_msg("perk");
                   if (pri_weapon_used and (Get_Skill_Right == SKILL_SMALL_GUNS) and attack_type == ATKTYPE_RWEP2)
                   or (sec_weapon_used and (Get_Skill_Left == SKILL_SMALL_GUNS) and attack_type == ATKTYPE_LWEP2) then begin
                      //display_msg("checks");
              expert_shooter_ap := vanilla_ap_cost - has_fake_perk(ExpertShooter);
                      if (expert_shooter_ap < 2) then begin
                             expert_shooter_ap := 2;
                          end
                          set_sfall_return(expert_shooter_ap);
                          //display_msg("weapon ap vanilla_ap_cost " + vanilla_ap_cost + " expert_shooter_ap " + expert_shooter_ap);
                   end
                   if (pri_weapon_used or sec_weapon_used) and ((attack_type == hit_left_weapon_reload) or (attack_type == hit_right_weapon_reload)) then begin
                      expert_shooter_ap := vanilla_ap_cost - has_fake_perk(ExpertShooter);
                          if expert_shooter_ap < 0 then begin
                             expert_shooter_ap := 0;
                          end
                      set_sfall_return(expert_shooter_ap);
                          //display_msg("reload ap vanilla_ap_cost " + vanilla_ap_cost + " expert_shooter_ap " + expert_shooter_ap);
          end
           end                  
        end
end

procedure Get_Skill_Right begin
   weapon_stat := get_proto_data(obj_pid(pri_weapon_used), PROTO_IT_FLAGS); /* attack mode */
   weapon_stata := get_proto_data(obj_pid(pri_weapon_used), PROTO_WP_ANIM); /* animation by weapon type */
   weapon_state := attack_type;
   //display_msg("weapon_used " + weapon_used);
   //display_msg("weapon_stata " + weapon_stata + "  weapon_stat  " +  weapon_stat + "  weapon_state  " +  weapon_state );
   if (not(weapon_stat bwand 256) and ((weapon_state == 0) and (weapon_stat bwand 6) or ((weapon_state == 1) and (weapon_stat bwand 96))
   or ((weapon_state == 2) and (weapon_stat bwand 6) or ((weapon_state == 3) and (weapon_stat bwand 96)))
   or ((weapon_state == 0) and (weapon_stat bwand 7) or ((weapon_state == 1) and (weapon_stat bwand 112)))
   or ((weapon_state == 2) and (weapon_stat bwand 7) or ((weapon_state == 3) and (weapon_stat bwand 112))))) then begin
      //display_msg("SKILL_SMALL_GUNS");
      return SKILL_SMALL_GUNS;
   end else begin
      //display_msg("error");
      return -1;
   end
end  

procedure Get_Skill_Left begin
   weapon_stat := get_proto_data(obj_pid(sec_weapon_used), PROTO_IT_FLAGS); /* attack mode */
   weapon_stata := get_proto_data(obj_pid(sec_weapon_used), PROTO_WP_ANIM); /* animation by weapon type */
   weapon_state := attack_type;
   //display_msg("weapon_used " + weapon_used);
   //display_msg("weapon_stata " + weapon_stata + "  weapon_stat  " +  weapon_stat + "  weapon_state  " +  weapon_state );
   if (not(weapon_stat bwand 256) and ((weapon_state == 0) and (weapon_stat bwand 6) or ((weapon_state == 1) and (weapon_stat bwand 96))
   or ((weapon_state == 2) and (weapon_stat bwand 6) or ((weapon_state == 3) and (weapon_stat bwand 96)))
   or ((weapon_state == 0) and (weapon_stat bwand 7) or ((weapon_state == 1) and (weapon_stat bwand 112)))
   or ((weapon_state == 2) and (weapon_stat bwand 7) or ((weapon_state == 3) and (weapon_stat bwand 112))))) then begin
      //display_msg("SKILL_SMALL_GUNS");
      return SKILL_SMALL_GUNS;
   end else begin
      //display_msg("error");
      return -1;
   end
end  

沙发
发表于 2019-7-18 19:54:56 | 只看该作者
1. proto延展旗標的有效旗標值只有/* Item Common Flags */下面那六個。
2. 對。
3. 你如果只想取消單槍客的效果,用perks.ini然後設定成這樣:
[t3]
NoHardcode=1

看來你是改Nirran的東西,我建議多參考一下modderspack內的文件,他有些東西是用舊的方法去實行,sfall後來有些新增函式/hook或許可以用比較簡單的方式做到同樣的事。

板凳
 楼主| 发表于 2019-7-18 23:06:12 | 只看该作者
novarain 发表于 2019-7-18 19:54
1. proto延展旗標的有效旗標值只有/* Item Common Flags */下面那六個。
2. 對。
3. 你如果只想取消單槍 ...

我靠只有6个啊,老子实验了几个小时...
可是,如果只有6个能用,那这个脚本为何用了其他的参数呢?

另外...你知道有啥比较新的,调整伤害计算的mod吗,也就是hs_combatdamage.int或者hs_subcombatdmg.int...
地板
发表于 2019-7-18 23:31:24 | 只看该作者
我搞錯了,那些ATKMODE_*也可以用,只是那判定方式看了實在有點傷眼。
你要參考CombatDamage hook可以看FO2tweak內的版本,至於新的SubCombatDamage沒人實際做過什麼東西。
5#
 楼主| 发表于 2019-7-19 19:44:04 | 只看该作者
可以用吗...那看来我用错了...+_+
算了,反正想要的效果都做出来了...
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Archiver|13号避难所

GMT+8, 2024-5-2 06:57 , Processed in 0.055590 second(s), 13 queries .

快速评论 返回顶部 返回列表